Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Restricting "su"

Status
Not open for further replies.

mediatech

Technical User
Joined
Apr 27, 2001
Messages
6
Location
NL
I have written an "su" wrapper script which limits which users can switch, to which accounts. It all works very well until I call it as part of my Serviceguard package. The only line that is significant is:

su "$@"

This calls the real "su" from my script. If it is passed the following command (from Serviceguard), I get an "su" usage error:

su_script - iaa -c "/appl/iaa/bin/iaa &" > /dev/null 2&1

The problem appears to be that the "$@" is parsed differently when run from Serviceguard, than from a regular shell prompt. I suspect that this is a really obvious and stupid problem, and the answer will be staring me in the face. The log produced by tracing my script in the foreground shows:

+ Update_log User:co1217 switches to iaa
+ Update_log Command is: "/usr/sbin/su.orig - iaa -c /appl/iaa/bin/iaa &"
+ Update_log Script Completed!
+ print -u4 - =================
+ exec
+ 4> -
+ /usr/bin/su.orig - iaa -c /appl/iaa/bin/iaa &

whereas from Serviceguard, the "su.orig" gives a usge error for each of the arguments.

Any ideas????
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top