From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7183 invoked from network); 10 Jun 1997 06:14:07 -0000 Received: from euclid.skiles.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 10 Jun 1997 06:14:07 -0000 Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id BAA08309; Tue, 10 Jun 1997 01:56:24 -0400 (EDT) Resent-Date: Tue, 10 Jun 1997 01:56:24 -0400 (EDT) Date: Tue, 10 Jun 1997 09:59:56 +0400 (MSD) From: Andrej Borsenkow X-Sender: bor@itsrm1 Reply-To: borsenkow.msk@sni.de To: Juergen Peter bluen cc: zsh-workers@math.gatech.edu Subject: Re: incorrect behavior of zsh under su on SUNOS-4.1.3 In-Reply-To: <199706090840.KAA02522@ee.uni-sb.de> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=iso-8859-1 Content-Transfer-Encoding: 8BIT Resent-Message-ID: <"FsxMd3.0.m12.7oEdp"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/3226 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu On Mon, 9 Jun 1997, Juergen Peter bluen wrote: > Hello Folks, > > Some problems have been encountered here when using ZSH-3.1.2 on a > SunOS-4.1.3 system. > > It looks very much like that if invoked from other programs in a way > like > > exec("/path/to/zsh", argv[0], other_args) > > 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. > > 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), which isnīt correct behaviour according to the > documentation of su(1). Other programs calling exec*(2) in a similar > way lead to the same problem (I checked elm-2.4 for example). > I just tried it with my /bin/su, and I don't quite understand, what do you mean. If called as 'su user' zsh is called with execve ("/usr/bin/zsh", "zsh", ...) and if called as 'su - user' zsh is called with execve ("/usr/bin/zsh", "-zsh", ...) The problem in the first case is, that environment is not changed, that is, HOME still points to original user's home, and zsh tries to source startup files from wrong directory. If they don't exist (e.g., on my system root doesn't have ~/.z* files at all), it appears, as if startup files weren't sourced. could you provide example of exact exec's in your case? greetings ------------------------------------------------------------------------- Andrej Borsenkow Fax: +7 (095) 252 01 05 SNI ITS Moscow Tel: +7 (095) 252 13 88 NERV: borsenkow.msk E-Mail: borsenkow.msk@sni.de -------------------------------------------------------------------------