Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"admin can sudo" dep doesn't ensure that admin can sudo #5

Open
rweng opened this issue Aug 23, 2011 · 0 comments
Open

"admin can sudo" dep doesn't ensure that admin can sudo #5

rweng opened this issue Aug 23, 2011 · 0 comments

Comments

@rweng
Copy link

rweng commented Aug 23, 2011

Problem: on a system of mine I had %admin ALL=NOPASSWD:ALL already in the sudoers file. It is ubuntu-10.04 LTS, however, modified by the hoster. The problem with the line is, that users of group admin cant use for instance sudo -u postgres, because the =(ALL) is missing.

The dependency:
dep 'admins can sudo' do requires 'admin group' met? { !sudo('cat /etc/sudoers').split("\n").grep(/^%admin/).empty? } meet { append_to_file '%admin ALL=(ALL) ALL', '/etc/sudoers', :sudo => true } end

Maybe we should grep for the entire line in met? In meet, we could let the user decide whether to overwrite the line or not. What do you think?

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

No branches or pull requests

1 participant