[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SOLARIS: su - user not passing cmd args



> Did you put the args in quotes?

Yep. Here's a new twist, and I think clinches it to be a bug.

   su - user -c 'cmd arg1 arg2 arg3' arg4 arg5 arg6 arg7

.profile sees:   $0=arg4 $1=arg5 $2=arg6 $3=arg7
su'd shell sees: $0=cmd  $1=arg1 $2=arg2 $3=arg3 (and *only* those 3 args, too)

And if you display the value of the 'tty' command, the .profile returns
the tty of the calling 'su' command's shell (i.e. a real tty), while the
su'd shell will display 'not a tty'.

There's some parameter mis-matching going on here, and it's a bug, or
there is some *severely* under-documented behavior going on. It is not
at *all* clear from the 'su', 'login' or 'ksh' documentation who gets
what arguments and who does what command-line expansions and quoting here.

I really think this may be an off-by-one bug somewhere, in that the .profile
never "sees" that first argument. But what's strange is that _ONLY_ the first
argument is what's passed to the subshell, and only the .profile sees
the others.

Mike/

---------------------------------------------
http://www.valuenet.net



-
To unsubscribe, send email to majordomo@silug.org with
"unsubscribe silug-discuss" in the body.