Description of problem: If you run /usr/sbin/rhn-satellite as a non-root user, you can get all kinds of messy results, for example: -bash-3.2$ /usr/sbin/rhn-satellite status jabberd router is stopped Oracle Net Listener (pid 4333) is running... Oracle DB instance rhnsat is stopped osa-dispatcher (pid 4389) is running... /etc/init.d/tomcat5 is already running (4918) httpd (pid 4939) is running... Sorry, you *must* be root to use this program Compilation failed in require at /usr/sbin/Monitoring line 8. BEGIN failed--compilation aborted at /usr/sbin/Monitoring line 8. Sorry, you *must* be root to use this program Compilation failed in require at /usr/sbin/MonitoringScout line 8. BEGIN failed--compilation aborted at /usr/sbin/MonitoringScout line 8. rhn-search is running (4985). cobblerd dead but subsys locked RHN Taskomatic is running (5033). With the suggested patch, running the same command will produce a much cleaner result, and stop a non-root user from executing anything: -bash-3.2$ /usr/sbin/rhn-satellite status This script must be run as root! Version-Release number of selected component (if applicable): Red Hat Network (RHN) Satellite 5.3.0 How reproducible: Always. Steps to Reproduce: 1. su - oracle (or any non-root user); 2. /usr/sbin/rhn-satellite status (or stop/start/restart etc) Actual results: Messy output, see problem description above. Expected results: Clean exit with message explaining it needs to be run as root. Additional info: Proposed patch from customer attached.
Created attachment 369138 [details] proposed patch
Fixed in spacewalk master commit 01621e7908ea2f405b4cee20e0cc4028fb13f8c3 536989 - exit cleanly when run by non-root
QA: Changing to VERIFIED: Testing procedure $ /usr/sbin/rhn-satellite Results: Script printouts "This script must be run as root!\n\n" for all use cases. (As proposed in the patch). QA: Adding RHTS keywork. This should be extremely easy to automate. Verified against: Satellite-5.4.0-RHEL5-re20101001.1
Verified in stage. -bash-3.2$ /usr/sbin/rhn-satellite status This script must be run as root!
The 5.4.0 RHN Satellite and RHN Proxy release has occurred. This issue has been resolved with this release. RHEA-2010:0801 - RHN Satellite Server 5.4.0 Upgrade https://rhn.redhat.com/rhn/errata/details/Details.do?eid=10332 RHEA-2010:0803 - RHN Tools enhancement update https://rhn.redhat.com/rhn/errata/details/Details.do?eid=10333 RHEA-2010:0802 - RHN Proxy Server 5.4.0 bug fix update https://rhn.redhat.com/rhn/errata/details/Details.do?eid=10334 RHEA-2010:0800 - RHN Satellite Server 5.4.0 https://rhn.redhat.com/rhn/errata/details/Details.do?eid=10335 Docs are available: http://docs.redhat.com/docs/en-US/Red_Hat_Network_Satellite/index.html Regards, Clifford