Fix log_dir_group for Ubuntu 14.04+#83
Fix log_dir_group for Ubuntu 14.04+#83chris-rock merged 1 commit intodev-sec:masterfrom shoekstra:fix_log_dir_perms
Conversation
| # author: Dominik Richter | ||
| # author: Patrick Muench | ||
|
|
||
| log_dir_group = case os[:family] |
There was a problem hiding this comment.
could we just switch to use os.name instead?
| os[:release] == '14.04' ? 'syslog' : 'root' | ||
| end | ||
| log_dir_group = 'root' | ||
| log_dir_group = 'syslog' if os.name == 'ubuntu' && os[:release].to_i >= 14 |
There was a problem hiding this comment.
@chris-rock I'm using os.name here in the replacement :)
There was a problem hiding this comment.
I thought easiest just to override default of log_dir_group = 'root' if Ubuntu 14.04+ as the case statement seemed overkill. If there are platforms that deviate in the future then happy to put it back.
There was a problem hiding this comment.
I agree with you. Thank you for making it simpler!
There was a problem hiding this comment.
I think we could remove version check completely as it does not really make sense (and ubuntu 16.04 has group 'syslog' as well)
log_dir_group = os.name == 'ubuntu'? 'syslog' : 'root'
chris-rock
left a comment
There was a problem hiding this comment.
Great improvement @shoekstra
| os[:release] == '14.04' ? 'syslog' : 'root' | ||
| end | ||
| log_dir_group = 'root' | ||
| log_dir_group = 'syslog' if os.name == 'ubuntu' && os[:release].to_i >= 14 |
There was a problem hiding this comment.
I agree with you. Thank you for making it simpler!
Currently the
casestatement won't work asos[:family]on Ubuntu systems isdebian, this fixes that.