Skip to content

Commit da8070c

Browse files
committed
Incorrect message when running rabbitmq-plugins as non-root user
Addresses the confusion shown in the following: * #15685 (comment) * #15686 Basically, a RabbitMQ user thought they should be able to run the `rabbitmq-plugins` command as either `root` or `rabbitmq`, when, in fact, only the `root` user is allowed.
1 parent 6854b1e commit da8070c

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

scripts/rabbitmq-script-wrapper

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,15 @@ exec_script_as_root() {
102102
run_script_help_and_fail() {
103103
"/usr/lib/rabbitmq/bin/$SCRIPT" help
104104

105-
echo "
106-
Only root or rabbitmq can run $SCRIPT
107-
"
105+
msg="Only root or rabbitmq can run $SCRIPT"
106+
if calling_rabbitmq_plugins
107+
then
108+
msg="Only root can run $SCRIPT"
109+
fi
110+
111+
echo
112+
echo "$msg"
113+
echo
108114
exit 1
109115
}
110116

0 commit comments

Comments
 (0)