Bug 1036780 - rabbitmq-server wrapper script drops arguments
Summary: rabbitmq-server wrapper script drops arguments
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: rabbitmq-server
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Peter Lemenkov
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-12-02 15:38 UTC by Robert Buchholz
Modified: 2026-04-25 01:26 UTC (History)
5 users (show)

Fixed In Version: rabbitmq-server-4.0.9-2.fc43 rabbitmq-server-4.2.5-2.fc44
Clone Of:
Environment:
Last Closed: 2026-04-04 00:48:45 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Improved and greatly simplified wrapper (207 bytes, text/plain)
2016-08-29 08:33 UTC, Tuomo Soini
no flags Details

Description Robert Buchholz 2013-12-02 15:38:04 UTC
Description of problem:
the wrapper script /usr/sbin/rabbitmqctl drops all arguments to the command in certain cases, for example when the calling user is not root.

I am running a rabbitmq node as a local user (for development) as a regular user, outside of /var. This works fine, however the Fedora-specific wrapper to "rabbitctl" will obscure access to the rabbitctl script. It took me quite a while to debug what was happening, until I found out the command is really a wrapper whose sole purpose is munging arguments -- and it does it wrong.


Version-Release number of selected component (if applicable):
I am on 3.1.5-1.fc19 but I see the same bug in rawhide.

How reproducible:
Always.

Steps to Reproduce:
1. Be non-root / non-rabbitmq user
2. Run rabbitmqctl status


Actual results:
    Error: could not recognise command
    Usage:
    rabbitmqctl [-n <node>] [-q] <command> [<command options>] 
...

Expected results:
Status of node rabbit@localhost ...
[{pid,1234},...


Additional info:
The warning "Only root or rabbitmq should run" should really be "Only root or rabbitmq must run", as currently it makes it impossible for anyone else.
However, this is not true, as any user *can* run rabbitmq.
Furthermore, users in the rabbitmq group should be able to run management commands, given the correct parameters.
Lastly, the "rabbitmq-plugins" case looks fishy too, as it allows anyone to run the rabbitmq-plugins command, and makes the first line obsolete.

Comment 1 Fedora Admin XMLRPC Client 2014-07-01 17:58:14 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 2 Jaroslav Reznik 2015-03-03 15:15:05 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 22 development cycle.
Changing version to '22'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora22

Comment 3 Tuomo Soini 2016-08-29 08:33:22 UTC
Created attachment 1195211 [details]
Improved and greatly simplified wrapper

Greatly simplified wrapper script which works properly for non-root users too.

Comment 4 Peter Lemenkov 2026-03-08 17:04:54 UTC
Bug CONFIRMED still present in current rabbitmq-server package.

Testing as non-root user shows the exact issue reported in 2013:

$ rabbitmqctl status
/usr/bin/rabbitmqctl: строка 47: cd: /var/lib/rabbitmq: Отказано в доступе
[shows help text]
Only root or rabbitmq can run rabbitmqctl

The wrapper script at /usr/bin/rabbitmqctl fails to cd into /var/lib/rabbitmq for non-root users, then drops all arguments and displays help instead of executing the command.

This is a 10+ year old bug that needs to be addressed. Attachment 1195211 [details] from 2016 contains a proposed fix.

Comment 5 Peter Lemenkov 2026-03-08 17:08:00 UTC
CONFIRMED: Bug persists even for users in rabbitmq group.

After adding user to rabbitmq group:
$ groups
rabbitmq wheel mock petro
$ rabbitmqctl status
[shows help text]
Only root or rabbitmq can run rabbitmqctl

The wrapper script has fundamental logic flaws that prevent ANY non-root user from running rabbitmqctl, even when in the rabbitmq group. The 2016 patch in attachment 1195211 [details] should be reviewed and applied.

This 10+ year old bug blocks legitimate use cases like developers running local RabbitMQ instances.

Comment 6 Peter Lemenkov 2026-03-08 17:21:34 UTC
VERIFIED: Simplified wrapper works perfectly!

Tested the 2016 patch (simplified 9-line wrapper) and it successfully passes all arguments to the actual rabbitmqctl binary. Non-root users can now execute rabbitmqctl commands without the wrapper blocking them.

Test command:
$ ~/.local/bin/rabbitmqctl status

Result: Successfully invoked the actual rabbitmqctl binary, which attempted to connect to RabbitMQ server (expected behavior - shows proper argument passing).

The simplified wrapper approach is the correct fix. Will package this for rawhide, F44, and F43.

Comment 7 Fedora Update System 2026-03-26 13:05:54 UTC
FEDORA-2026-0332be789f (rabbitmq-server-4.2.5-2.fc44) has been submitted as an update to Fedora 44.
https://bodhi.fedoraproject.org/updates/FEDORA-2026-0332be789f

Comment 8 Fedora Update System 2026-03-26 13:05:55 UTC
FEDORA-2026-99fed72bd2 (rabbitmq-server-4.0.9-2.fc43) has been submitted as an update to Fedora 43.
https://bodhi.fedoraproject.org/updates/FEDORA-2026-99fed72bd2

Comment 9 Peter Lemenkov 2026-03-26 13:07:27 UTC
Fixed in rabbitmq-server-4.2.5-2.fc45 (rawhide), rabbitmq-server-4.2.5-2.fc44, and rabbitmq-server-4.0.9-2.fc43. All submitted to Bodhi.

The wrapper script has been replaced with a simplified version that correctly passes all arguments for both root and non-root users. When running as root, runuser is used to switch to the rabbitmq user with a CWD fix to avoid Erlang's code_server failing on unreadable directories.

Comment 10 Fedora Update System 2026-03-27 01:40:59 UTC
FEDORA-2026-0332be789f has been pushed to the Fedora 44 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2026-0332be789f`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2026-0332be789f

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 11 Fedora Update System 2026-03-27 01:53:02 UTC
FEDORA-2026-99fed72bd2 has been pushed to the Fedora 43 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2026-99fed72bd2`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2026-99fed72bd2

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 12 Fedora Update System 2026-04-04 00:48:45 UTC
FEDORA-2026-99fed72bd2 (rabbitmq-server-4.0.9-2.fc43) has been pushed to the Fedora 43 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 13 Fedora Update System 2026-04-25 01:26:15 UTC
FEDORA-2026-0332be789f (rabbitmq-server-4.2.5-2.fc44) has been pushed to the Fedora 44 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.