Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: incorrect behavior of zsh under su on SUNOS-4.1.3



Juergen Peter "bluen wrote:
>what many programs do to spawn a shell or a subshell,
>zsh_name (the variable in the sourcecode) is set to argv[0] of the
>spawning program.

zsh_name is set to zsh's argv[0], which is whatever the execing program
wants it to be.

>This looks quite ok for me (at least for most programs), but when the
>shell-spawning program is /bin/su (or /usr/5bin/su) of SunOS, this
>prevents the shell from reading its initialisation files (/etc/zshenv
>and so on),

Opinion: this behaviour of su is broken.  It should set argv[0]
conventionally -- the shell has no need to know it is being run by su.

>	if zsh_name is set to something different than zsh (or -zsh),
>	always set it to "zsh", so that init files are read for every
>	subshell in the ususal way.

No, there's a reason why zsh_name gets set to argv[0].  zsh will emulate
ksh or POSIX sh if argv[0] (and therefore zsh_name) are set to "ksh" or
"sh".  If zsh_name were always "zsh", there wouldn't be any point in it
being a variable.

-zefram



Messages sorted by: Reverse Date, Date, Thread, Author