Bug 521764

Summary: runuser preferred to su -
Product: Red Hat Satellite 5 Reporter: Tomas Lestach <tlestach>
Component: ServerAssignee: Jan Pazdziora <jpazdziora>
Status: CLOSED DUPLICATE QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: medium Docs Contact:
Priority: low    
Version: 530CC: cperry, jpazdziora, msuchy
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-21 11:54:14 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 462714    

Description Tomas Lestach 2009-09-08 09:13:29 UTC
Description of problem:
According to BZ#460547, all occurrences of "su -" shall be replaced by "runuser"

Version-Release number of selected component (if applicable):
Satellite-5.3.0-RHEL5-re20090820.1

How reproducible:
always

Steps to Reproduce:
1. grep -r "su -" ./<path-to-spacewalk-git-directory>
  
Results:
...
./backend/satellite_tools/spacewalk-debug:    /bin/su - oracle -c "/usr/bin/db-control report" > $DIR/db-control-report
./web/modules/dobby/scripts/db-control:  $cli->fatal("Error: please run this command as the $username user ('su - oracle').");
...

(Not all of the grep results have to be replaced.)

Additional info:
All necessary info in BZ#460547.

Comment 1 Miroslav Suchý 2012-03-17 18:37:35 UTC
Fixed in spacewalk.git commit 83d6be2bc585ae04178c12334c3b5d219335ca38

I left untouched:
monitoring/PerlModules/NP/Probe/rhn-runprobe:    print "Please 'su - nocpulse' to run this program as uid $1 may not run /opt/home/nocpulse/bin/runprobe.pl.\n";
monitoring/rhnmd/rhnmd.init.SUSE:SU="/bin/su -s /bin/bash - nocpulse -c"
monitoring/rhnmd/rhnmd.init.SUSE:               /bin/su -s /bin/bash -c "/usr/bin/ssh-keygen -q -t dsa -N '' -f $IDENTITY" - nocpulse
web/modules/dobby/scripts/db-control:  $cli->fatal("Error: please run this command as the $username user ('su - oracle').");

I did not changed those suse bits, because I'm not sure if SUSE has runuser.

I did not changed rest, because it may be run by ordinary user, while runuser is intended only for root.

Comment 3 Jan Pazdziora 2012-06-21 11:54:14 UTC
The fix 83d6be2bc585ae04178c12334c3b5d219335ca38 became obsolete by fix for bug 828804 where we removed the user switch altogether: 5474173de9555402c9175a016c2d1491404b81e0.

*** This bug has been marked as a duplicate of bug 828804 ***