From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13355 invoked from network); 29 Dec 2008 04:32:52 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 29 Dec 2008 04:32:52 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 19370 invoked from network); 29 Dec 2008 04:32:43 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 29 Dec 2008 04:32:43 -0000 Received: (qmail 7180 invoked by alias); 29 Dec 2008 04:32:40 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 26186 Received: (qmail 7163 invoked from network); 29 Dec 2008 04:32:40 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 29 Dec 2008 04:32:40 -0000 Received: from prunille.vinc17.org (vinc17.pck.nerim.net [213.41.242.187]) by bifrost.dotsrc.org (Postfix) with ESMTP id 01C7380308BE for ; Mon, 29 Dec 2008 05:32:35 +0100 (CET) Received: by prunille.vinc17.org (Postfix, from userid 501) id AFA822F6FE9E; Mon, 29 Dec 2008 05:32:24 +0100 (CET) Date: Mon, 29 Dec 2008 05:32:24 +0100 From: Vincent Lefevre To: zsh-workers@sunsite.dk Cc: 510038@bugs.debian.org Subject: Re: Bug#510038: zsh: glob qualifer - doesn't work correctly on dangling symlinks Message-ID: <20081229043224.GA6476@prunille.vinc17.org> Mail-Followup-To: zsh-workers@sunsite.dk, 510038@bugs.debian.org References: <20081228214141.GA7972@ay.vinc17.org> <20081229034114.GA1911@scru.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20081229034114.GA1911@scru.org> X-Mailer-Info: http://www.vinc17.org/mutt/ User-Agent: Mutt/1.5.18-vl-r26315 (2008-12-20) X-Virus-Scanned: ClamAV 0.92.1/8806/Mon Dec 29 04:00:01 2008 on bifrost X-Virus-Status: Clean On 2008-12-29 03:41:14 +0000, Clint Adams wrote: > On Sun, Dec 28, 2008 at 10:41:41PM +0100, Vincent Lefevre wrote: [...] > > +zsh:9> ls -l file1 file2 file3 > > -rw-r--r-- 1 lefevre lefevre 0 2008-12-28 22:34:28 file1 > > lrwxrwxrwx 1 lefevre lefevre 5 2008-12-28 22:34:28 file2 -> file1 > > lrwxrwxrwx 1 lefevre lefevre 5 2008-12-28 22:34:28 file3 -> file0 > > +zsh:10> ls -l file3 > > lrwxrwxrwx 1 lefevre lefevre 5 2008-12-28 22:34:28 file3 -> file0 > > > > file*(-W) should have no matches. > > > > zsh 4.3.9 on my Mac OS X machine behaves correctly. > > Are you sure? Is the stat() call succeeding on MacOS even if the > link is dangling? Here's the kdump on Mac OS X: 7035 zsh CALL lstat(0xbfffb0d9,0xbfffb54c) 7035 zsh NAMI "file1" 7035 zsh RET lstat 0 7035 zsh CALL lstat(0xbfffb0d9,0xbfffb54c) 7035 zsh NAMI "file2" 7035 zsh RET lstat 0 7035 zsh CALL stat(0xbfffb0d9,0xbfffb5ac) 7035 zsh NAMI "file2" 7035 zsh RET stat 0 7035 zsh CALL lstat(0xbfffb0d9,0xbfffb54c) 7035 zsh NAMI "file3" 7035 zsh RET lstat 0 7035 zsh CALL stat(0xbfffb0d9,0xbfffb5ac) 7035 zsh NAMI "file3" 7035 zsh RET stat -1 errno 2 No such file or directory 7035 zsh CALL getdirentries(0x3,0x1807800,0x1000,0x409594) 7035 zsh RET getdirentries 0 7035 zsh CALL lseek(0x3,0,0) 7035 zsh RET lseek 0 7035 zsh CALL close(0x3) 7035 zsh RET close 0 7035 zsh CALL ioctl(0x2,0x4004667a ,0xbfffb6a8) 7035 zsh RET ioctl 0 7035 zsh CALL write(0x2,0x87b24,0x21) 7035 zsh GIO fd 2 wrote 33 bytes "zsh: no matches found: file*(-W) " Seems OK. BTW, there's a bug earlier: a file is closed twice: 7028 zsh CALL write(0x2,0x87b24,0x13) 7028 zsh GIO fd 2 wrote 19 bytes "+zsh:2> echo 4.3.9 " 7028 zsh RET write 19/0x13 7028 zsh CALL write(0x1,0x87f24,0x6) 7028 zsh GIO fd 1 wrote 6 bytes "4.3.9 " 7028 zsh RET write 6 7028 zsh CALL close(0xd) 7028 zsh RET close 0 7028 zsh CALL close(0xd) 7028 zsh RET close -1 errno 9 Bad file descriptor -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)