zsh-workers
 help / color / mirror / code / Atom feed
* zgetcwd with bind mounts
@ 2010-06-12 20:00 Anthony Heading
  0 siblings, 0 replies; only message in thread
From: Anthony Heading @ 2010-06-12 20:00 UTC (permalink / raw)
  To: zsh-workers

Hi,

It seems zgetcwd can't handle bind mounts, leading to rather surprising
behaviour.

# echo $ZSH_VERSION $ZSH_PATCHLEVEL
4.3.10 Debian
# pwd
/home/ajrh
# mkdir -p /tmp/xvar
# mount --bind /var /tmp/xvar
# pwd
/home/ajrh
# env | grep PWD
PWD=/home/ajrh OLDPWD=/home/ajrh
# perl -e 'chdir("/tmp/xvar/log/samba"); system qw(dash -c /bin/pwd)'
/tmp/xvar/log/samba
# perl -e 'chdir("/tmp/xvar/log/samba"); system qw(bash -c /bin/pwd)'
/tmp/xvar/log/samba
# perl -e 'chdir("/tmp/xvar/log/samba"); system qw(zsh -c /bin/pwd)'
/tmp/xvar

I suspect this check in zgetdir is close to the problem; the dev != pdev
test is not sufficient to detect bind mounts.
# ifdef HAVE_STRUCT_DIRENT_D_INO
            if (dev != pdev || (ino_t) de->d_ino == ino)
# endif /* HAVE_STRUCT_DIRENT_D_INO */

For QNX and cygwin, zsh simply uses getcwd() instead of this code - why
is that not used generally?

Anthony


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-06-12 20:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-12 20:00 zgetcwd with bind mounts Anthony Heading

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).