Red Hat Bugzilla – Bug 12795
su -c is broken
Last modified: 2008-05-01 11:37:56 EDT
Apparently the su(1) program in the fileutils package cannot handle
multiple-length -c arguments. (The -c argument is used by su(1) to execute
a program or script other than a shell as a different user.)
For example, I cannot get this to work, although the man page says it
should, and it works correctly in other su(1) implementations:
su user -c /path/to/exec argument argument ...
I've also tried this form:
su -c "/path/to/exec argument argument" user
and it doesn't work either.
Both su username -c "/path/program arguments" and su -c "/path/program
arguments" username work for me...
Try reinstalling the sh-utils package (rpm -Uvh --force
/mnt/cdrom/RedHat/RPMS/sh-utils*), maybe someone messed up your installation.