Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
zgetcwd with bind mounts
- X-seq: zsh-workers 28028
- From: "Anthony Heading" <ajrh@xxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: zgetcwd with bind mounts
- Date: Sat, 12 Jun 2010 16:00:49 -0400
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=message-id:from:to:mime-version:content-transfer-encoding:content-type:subject:date; s=smtpout; bh=rk/TYjD/ZcdnNGtnduWO4dXiFTM=; b=UadJntVbR3aG3aJlWMAjjZDQBj5Bbpb8bSMdckPWNTY6ykvwT2DoGzOnWxwfD3cs6+6nS4KRGHgrc96c9MkVDBKYi8//z+M77udNNGfqVEisHXLo90yrodZRMxO2vzOg03GSiYs/8Gfccop4atSxq7kYwcHcERSMfkjiLRUYrRc=
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author