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

Correct SUDO detection on Mac OS X #443

Closed
wants to merge 1 commit into from

Conversation

anthonygelibert
Copy link
Contributor

Correct SUDO detection on Mac OS X where true isn't a provided as a /bin command.

@dolmen
Copy link
Collaborator

dolmen commented Jun 1, 2016

So where is the true binary stored?

$ which true

@anthonygelibert
Copy link
Contributor Author

anthonygelibert commented Jun 1, 2016

Excuse-me… I was pretty hurry, I thought it was only a "shell built-in command" ("which true" in my ZSH).

After your answer, I checked with bash and it's in /usr/bin/true.

So, maybe a:
sudo env true

Will be better?

@dolmen
Copy link
Collaborator

dolmen commented Jun 1, 2016

The point of this line is to run quickly a dummy command that has a 0 exit code.
env true would fork one more time, so this misses the point.
I'm merging your patch as is.

@dolmen dolmen added bug MacOS X Related to MacOS X specific implementation sudo Related to the detection and display of sudo permissions merged! labels Jun 1, 2016
@dolmen
Copy link
Collaborator

dolmen commented Jun 1, 2016

Cherry-picked as 3d3061c. Thanks!

@dolmen dolmen closed this Jun 1, 2016
@dolmen dolmen self-assigned this Jun 1, 2016
dolmen added a commit that referenced this pull request Jun 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug MacOS X Related to MacOS X specific implementation sudo Related to the detection and display of sudo permissions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants