Use membership of "admin" group, rather than writing to /tmp#22
Open
graham-m-dunn wants to merge 4 commits intotbridge:masterfrom
Open
Use membership of "admin" group, rather than writing to /tmp#22graham-m-dunn wants to merge 4 commits intotbridge:masterfrom
graham-m-dunn wants to merge 4 commits intotbridge:masterfrom
Conversation
Owner
|
Hi Graham, Thanks for the PR! Can you walk me through what the new |
Author
|
So, if I understand what you're trying to do by writing the output of
whoami to a file, which is that if you're an admin user (IE, in the admin
group), the output is root. The id command outputs a numeric list of the
groups the current user belongs to, and we look for 80, which is the
groupid for admin.
Though now that I write this, I realize that id command is "recent", so
reject this PR, I need to make it work with older versions of OS X 😒
Thanks,
Graham
…On Thu, Feb 23, 2017, 6:49 PM Tom Bridge ***@***.***> wrote:
Hi Graham,
Thanks for the PR!
Can you walk me through what the new isadmin function does? I just want
to make sure I understand it before I merge it in.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#22 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AJF3ynSErRTnTAVbQmy2oI7BjnEs1VNdks5rfhslgaJpZM4MKpmg>
.
|
Author
|
Test code for isadmin() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Writing to known locations in your filesystem can be a security problem