From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13698 invoked from network); 10 Aug 1997 07:57:19 -0000 Received: from euclid.skiles.gatech.edu (list@130.207.146.50) by coral.primenet.com.au with SMTP; 10 Aug 1997 07:57:19 -0000 Received: (from list@localhost) by euclid.skiles.gatech.edu (8.8.5/8.8.5) id DAA29272; Sun, 10 Aug 1997 03:31:50 -0400 (EDT) Resent-Date: Sun, 10 Aug 1997 03:31:50 -0400 (EDT) Message-ID: <19970810003009.13551@molehill.org> Date: Sun, 10 Aug 1997 00:30:09 -0700 From: Todd Larason To: mason@primenet.com.au Cc: zsh-workers@math.gatech.edu Subject: Re: weird zsh startup behavior References: <199708090439.WAA04877@ghidora.uwyo.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.76e In-Reply-To: ; from Geoff Wing on Sat, Aug 09, 1997 at 05:11:53AM +0000 Resent-Message-ID: <"paLsJ3.0.G97.bvMxp"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/3434 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu On Sat, Aug 09, 1997 at 05:11:53AM +0000, Geoff Wing wrote: > John M. Harres typed: > :On Fri 8 Aug 1997, Zoltan Hidvegi wrote: > :> > Does anyone know under what circumstances zsh will change directory on > :> > startup? I was in root under sh, ran zsh, and zappo, switched directories, > :> > and not to root's home directory. Both home directories are automounted. > :> We can only fix this problem if you provide more details about the > :> problem. What zsh version, OS, OS version, libc version, compiler are > :> you using? Can you reproduce this with zsh -f? If not, try to find the > :> command in you startup files which triggers the problem. > :Sorry, brain on hold. zsh 3.0.4, Solaris 2.5.1, gcc-2.7.2.2, whatever libc > :Sun ships withe Solaris 2.5.1. > :Reproduced with zsh -f: > > Can you reproduce it with "zsh -f" and no /etc/zshenv? Ack, I never wrote the list about this, did I? I saw this on a similar setup - Solaris 2.4, home directories automounted, zsh 3.0 betas I think. I no longer have access to this system, so I can't double check the details, but they're not terribly important. The problem was an assumption made in zgetcwd(), which didn't hold with the automounted home dirs. I don't seem to have the patch I made, and I'm going on foggy memory here I'm afraid. Anything that caused a zgetcwd() would end up *changing* the current directory. Looking at zgetcwd, I'm thinking that the false assumption was that only one mountpoint could have the same device number ("if (sbuf.st_dev == dev) goto match;" around lines 178-179 in 3.0.4:compat.c). With sun's automounter, with multiple directories from the same device mounted into the same directory, this wasn't true. I assume my fix was to check the inode too. Sorry this is so vague and wishy washy, but hopefully it will save some time tracking down the details.