[rabbitmq-discuss] Can't use backtick in password

Kal Sze swordangel at gmail.com
Tue Aug 20 08:12:36 BST 2013

On Tuesday, 20 August 2013 14:27:15 UTC+8, Kal Sze wrote:

> Hello,
> I have RabbitMQ running on Ubuntu 12.04 and Debian Wheezy
> I'm trying to setup some RabbitMQ users with secure passwords, but it 
> looks like some characters don't get escaped correctly:
>     root at server:~# rabbitmqctl add_user foo "\`"
>     sh: 1: Syntax error: EOF in backquote substitution
> Best Regards,
> Kal

After obtaining some help from the #bash channel on Freenode IRC, it 
appears that the correct fix would be to use proper string substitution in 
the rabbitmqctl script:

Replace this line:\
    su rabbitmq -s /bin/sh -c "/usr/lib/rabbitmq/bin/${SCRIPT} ${CMDLINE}"

With this line:
    su rabbitmq -s /bin/sh -c 'script=$1; shift; "$script" "$@"' _ 
"/usr/lib/rabbitmq/bin/${SCRIPT}" "$@"

Credit goes to user zendeavor of the #bash channel on Freenode IRC.

Best Regards,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20130820/29c4c8d4/attachment.htm>

More information about the rabbitmq-discuss mailing list