diff options
| author | Simon MacMullen <simon@lshift.net> | 2008-11-25 17:08:11 +0000 |
|---|---|---|
| committer | Simon MacMullen <simon@lshift.net> | 2008-11-25 17:08:11 +0000 |
| commit | da544ab66fe45080942d41504630308641ebd633 (patch) | |
| tree | 988ad36f55a138349a5ed66d28c4178de2b231f2 | |
| parent | 80be88ed32a57ee5ae2cb783ac8ac562b35060c6 (diff) | |
| download | rabbitmq-server-git-da544ab66fe45080942d41504630308641ebd633.tar.gz | |
Only su to rabbitmq if the user is actually root (otherwise they will be prompted for a password which is incomprehensible). If they are not root, allow them to see help but otherwise fail (since if they run the real rabbitmqctl as a normal user it will talk to the wrong rabbit and again confusion will ensue.
| -rw-r--r-- | packaging/debs/Debian/debian/rabbitmqctl_wrapper | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/packaging/debs/Debian/debian/rabbitmqctl_wrapper b/packaging/debs/Debian/debian/rabbitmqctl_wrapper index 75b37c0d6c..32f677f509 100644 --- a/packaging/debs/Debian/debian/rabbitmqctl_wrapper +++ b/packaging/debs/Debian/debian/rabbitmqctl_wrapper @@ -10,5 +10,16 @@ for arg in "$@" ; do done cd / -su rabbitmq -s /bin/sh -c "/usr/lib/rabbitmq/bin/rabbitmqctl ${CMDLINE}" + +if [ ${UID} = 0 ] ; then + su rabbitmq -s /bin/sh -c "/usr/lib/rabbitmq/bin/rabbitmqctl ${CMDLINE}" + +elif [ $# = 0 -o \( $# = 1 -a "$1" = --help \) ] ; then + # Allow normal user to run for the help message + /bin/sh -c "/usr/lib/rabbitmq/bin/rabbitmqctl ${CMDLINE}" + +else + echo "Only root should run $0" + exit 1 +fi |
