-
-
Notifications
You must be signed in to change notification settings - Fork 136
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
Latest brew install needs extended sudo rights #109
Conversation
Hey, @Sauraus, have you completed the DCO step? https://blog.chef.io/2016/09/19/introducing-developer-certificate-of-origin/ Here is some more info. |
would really love this fix right now. 👍 |
user homebrew_owner | ||
not_if { ::File.exist? '/usr/local/bin/brew' } | ||
begin | ||
template '/etc/sudoers.d/homebrew_sudo' do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fails if /etc/sudoers.d
doesn't exist.
Something like...
...
directory '/etc/sudoers.d' do
action :nothing
end
template '/etc/sudoers.d/homebrew_sudo' do
notifies :create, 'directory[/etc/sudoers.d]', :before
...
...might help/fix it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/etc/sudoers.d
can only be missing if someone messed around with the system, not sure we need to account for people's tinkering with system paths.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tried running the patch on a fresh install of Mavericks.
/etc/sudoers.d
didn't seem to exist beforehand.
Other /etc
directories like /etc/ssh
don't exist either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mavericks... isn't that a little out dated and thus insecure to be used for anything?
But I do see your point, I've only done testing on 'new' OS X versions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm with you that it's older. However, chef-dk still supports 10.9. Plus the metadata.rb
file doesn't have any macOS version restrictions currently.
77956db
to
94e9d36
Compare
Why has this not been merged? |
@Sauraus There are a bunch of failures on CI from Rubocop—perhaps getting those fixed will move this along to getting merged 🙂 |
Additional errors I’m getting with this change applied onto 3.0.0:
After which I added |
e65c5ad
to
288cb95
Compare
I just ran several kitchen tests on my local mac and they all converged just fine, not a single fault to be found. |
@Sauraus Did you run rubocop linting though? This is what the failed build indicates. |
@discentem I did but I wasn't going to break the code just to satisfy
|
Signed-off-by: Antek S. Baranski <[email protected]>
@tas50 I've fixed the rubocop warnings, but the spec tests are something entirely different IMO. |
FWIW, as Sauraus seemed to see, we went the route of just installing Homebrew under its own system user which can do passwordless sudo. Then a “real” user just does e.g. |
@andrew-cc saw that yes, still scary to having a user with limitless |
Since it’s a user that can’t be logged-in to, some other user must use |
Agree with your sentiment. PS. Don't say any of that to the Homebrew maintainers @Brantone has experience with that... |
I'm going to close this out at this point because this just isn't an appropriate solution for most users. We try to implement the path of least surprise at Chef and giving blanket sudo rights is not going to be expected or desired by a good chunk of our userbase. |
This fixes: #105