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

Replace whoami with id -u test #397

Merged
merged 1 commit into from Feb 10, 2012
Merged

Conversation

@guns
Copy link
Contributor

@guns guns commented Feb 10, 2012

id -u is in the POSIX and LSB specs 1, while whoami is not.
Furthermore, the username of UID 0 can be changed (and is sometimes
recommended in a misguided attempt to increase security).

FreeBSD users logged in as toor would also slip through the cracks.

 http://refspecs.linuxfoundation.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/command.html
`id -u` is in the POSIX and LSB specs [1], while `whoami` is not.
Furthermore, the username of UID 0 can be changed (and is sometimes
recommended in a misguided attempt to increase security).

FreeBSD users logged in as `toor` would also slip through the cracks.

[1]: http://pubs.opengroup.org/onlinepubs/009695399/utilities/id.html
     http://refspecs.linuxfoundation.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/command.html
technomancy added a commit that referenced this issue Feb 10, 2012
Replace `whoami` with `id -u` test
@technomancy technomancy merged commit d645175 into technomancy:master Feb 10, 2012
@technomancy
Copy link
Owner

@technomancy technomancy commented Feb 10, 2012

Works for me; thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants