summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Sackman <matthew@lshift.net>2009-11-10 16:10:50 +0000
committerMatthew Sackman <matthew@lshift.net>2009-11-10 16:10:50 +0000
commit5b4df6c6fd0eec887a785ed75a7884599e77538d (patch)
treeae2cb2c768306f02f4c3326ae588cf477e81ed1b
parent88433c43c79f45b045656aa26e11650776d003d8 (diff)
downloadrabbitmq-server-bug21928.tar.gz
Fixes as suggested. Having tested, the asroot wrapper is used only with activate/deactivate, which don't take any arguments anyway, making testing argument passing a little challenging. However, minor editing of those scripts suggests that it does indeed seem to work.bug21928
-rw-r--r--packaging/common/rabbitmq-asroot-script-wrapper14
1 files changed, 2 insertions, 12 deletions
diff --git a/packaging/common/rabbitmq-asroot-script-wrapper b/packaging/common/rabbitmq-asroot-script-wrapper
index 9ef59ad7..c4a41847 100644
--- a/packaging/common/rabbitmq-asroot-script-wrapper
+++ b/packaging/common/rabbitmq-asroot-script-wrapper
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
## The contents of this file are subject to the Mozilla Public License
## Version 1.1 (the "License"); you may not use this file except in
## compliance with the License. You may obtain a copy of the License at
@@ -30,22 +30,12 @@
## Contributor(s): ______________________________________.
##
-# Escape spaces and quotes, because shell is revolting.
-for arg in "$@" ; do
- # Escape quotes in parameters, so that they're passed through cleanly.
- arg=$(sed -e 's/"/\\"/g' <<-END
- $arg
- END
- )
- CMDLINE="${CMDLINE} \"${arg}\""
-done
-
cd /var/lib/rabbitmq
SCRIPT=`basename $0`
if [ `id -u` = 0 ] ; then
- /usr/lib/rabbitmq/bin/${SCRIPT} ${CMDLINE}
+ /usr/lib/rabbitmq/bin/${SCRIPT} "$@"
else
echo -e "\nOnly root should run ${SCRIPT}\n"
exit 1