From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7565 invoked by alias); 31 May 2018 11:40:24 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 42904 Received: (qmail 27732 invoked by uid 1010); 31 May 2018 11:40:24 -0000 X-Qmail-Scanner-Diagnostics: from rcpt-mqugw.biglobe.ne.jp by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(133.208.100.3):SA:0(-2.6/5.0):. Processed in 1.358944 secs); 31 May 2018 11:40:24 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: takimoto-j@kba.biglobe.ne.jp X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | X-Biglobe-Sender: From: Jun T Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: [Bug] Strange Globing Behaviour when used with sudo Date: Thu, 31 May 2018 20:39:45 +0900 References: <1527707719.3469997.1390875592.73AD29B6@webmail.messagingengine.com> <20180530202349.GA10754@osmium.lan> <20180531094403.05b62bee@camnpupstephen.cam.scsc.local> <20180531084938eucas1p19a854d9e9ea17428cd6549f56a283356~zroN76sl33019130191eucas1p1K@eucas1p1.samsung.com> To: zsh-workers@zsh.org In-Reply-To: <20180531084938eucas1p19a854d9e9ea17428cd6549f56a283356~zroN76sl33019130191eucas1p1K@eucas1p1.samsung.com> Message-Id: <3977A049-90E6-4EDD-9E4C-8D2FF38593A3@kba.biglobe.ne.jp> X-Mailer: Apple Mail (2.3273) X-Biglobe-Spnum: 60365 > 2018/05/31 17:44, Peter Stephenson wrote: >=20 > On Wed, 30 May 2018 22:49:32 +0200 > Bengt Brodersen wrote: >> Just found a paragraph in stat(2) manpage on macos >=20 > If I've read this correctly, it sounds like it's worth trying to >=20 > #define _DARWIN_NO_64_BIT_INODE I think the problem is not related with these macros (or inode size), but anyway I manually added #define _DARWIN_NO_64_BIT_INODE #undef _DARWIN_USE_64_BIT_INODE (this is defined by AC_SYS_LARGEFILE) to config.h and built zsh; still the same problem for root. As Phil Pennock pointed out, the problem originates from: > 2018/05/31 5:23, Phil Pennock = wrote: > non-root: > stat64("./dummy/.\0", 0x7FFF5F8A1948, 0x1000) =3D -1 Err#20 >=20 > root: > stat64("./dummy/.\0", 0x7FFF547477C8, 0x1000) =3D 0 0 I believe this is a bug of macOS (or a "feature" related with the = "rootless" nature of the OS?). % ls dummy/. ls: dummy/.: Not a directory % sudo ls dummy/. dummy/. Same for "stat dummy/.". I've tested three system calls stat(2), lstat(2) and access(2) with the path "dummy/." and found that all succeed if called by root. If we want to workaround this "bug", we need to check st_mode of dummy somewhere in glob.c.=