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

Re: [list abuse] bug in /bin/csh and /usr/local/bin/tcsh?



>Q: Why do /bin/csh and /usr/local/bin/tcsh, as part of their startup
>   process, do an lstat of every directory in the root partition where
>   the shell was invoked?

They both do a getwd() call, which does the lstat()s.

The problem is that getwd() needs to search through each directory
as it moves up the file system heirarchy.  If they stumble across
a dead NFS mount, they hang.

For sh, it doesn't try to maintain a "PWD" variable, so it couldn't
care less.

For ksh, and zsh, it first tries to see if "HOME" or "PWD" is
the actual current working directory.  If so, they don't need
to do the getwd() call.

This is *the* feature I was prepared to sell my soul for when
Paul F. was first writing zsh, those many years ago.

The general solution, almost a mantra in some unix news groups,
is that you shouldn't NFS mount *anything* in /.

You might want to try a symlink to a more secure mount point.



Duncan.



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