Skip to content

Fix log_dir_group for Ubuntu 14.04+#83

Merged
chris-rock merged 1 commit intodev-sec:masterfrom
shoekstra:fix_log_dir_perms
Nov 10, 2017
Merged

Fix log_dir_group for Ubuntu 14.04+#83
chris-rock merged 1 commit intodev-sec:masterfrom
shoekstra:fix_log_dir_perms

Conversation

@shoekstra
Copy link
Copy Markdown
Contributor

Currently the case statement won't work as os[:family] on Ubuntu systems is debian, this fixes that.

Comment thread controls/os_spec.rb
# author: Dominik Richter
# author: Patrick Muench

log_dir_group = case os[:family]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we just switch to use os.name instead?

Comment thread controls/os_spec.rb
os[:release] == '14.04' ? 'syslog' : 'root'
end
log_dir_group = 'root'
log_dir_group = 'syslog' if os.name == 'ubuntu' && os[:release].to_i >= 14
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chris-rock I'm using os.name here in the replacement :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with you. Thank you for making it simpler!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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'

Copy link
Copy Markdown
Member

@chris-rock chris-rock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great improvement @shoekstra

Comment thread controls/os_spec.rb
os[:release] == '14.04' ? 'syslog' : 'root'
end
log_dir_group = 'root'
log_dir_group = 'syslog' if os.name == 'ubuntu' && os[:release].to_i >= 14
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with you. Thank you for making it simpler!

@chris-rock chris-rock merged commit 1bfc31a into dev-sec:master Nov 10, 2017
@shoekstra shoekstra deleted the fix_log_dir_perms branch November 10, 2017 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants