Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Replace "whoami" call with call to "id" in install_server.sh #781

Closed
wants to merge 1 commit into from

2 participants

@calebperkins

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
@mattsta mattsta closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 21, 2012
  1. @calebperkins
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 2 deletions.
  1. +2 −2 utils/install_server.sh
View
4 utils/install_server.sh
@@ -42,8 +42,8 @@ echo "This script will help you easily set up a running redis server
"
-#check for root user TODO: replace this with a call to "id"
-if [ `whoami` != "root" ] ; then
+#check for root user
+if [ `id -u` != 0 ] ; then
echo "You must run this script as root. Sorry!"
exit 1
fi
Something went wrong with that request. Please try again.