From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12705 invoked by alias); 14 Jun 2018 12:27:03 -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: 43014 Received: (qmail 5123 invoked by uid 1010); 14 Jun 2018 12:27:03 -0000 X-Qmail-Scanner-Diagnostics: from mail-it0-f41.google.com 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(209.85.214.41):SA:0(-1.9/5.0):. Processed in 1.939767 secs); 14 Jun 2018 12:27:03 -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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: bengt.brodersen@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=30bJHSBJbpDojxSc0bSme4rbVD4wjZrPn7xS0gwYbsc=; b=QUE0rEcmnL5vl0RHIgj4hE9fTs4ZR/g2joZkehZsfTpmvbKNVh60twLHrzTo/w90hT oC6n97GGCx4KmRfo4n/Ks3p9UCXaC8s4y6GTUe0yPUhEVh284Q1eO6WiFfUvQsMKJfVT UXNZFDOYBmA4bgOZPNwKobMddj/qXg1uw+kyxcbALFaHjZNKfGON7ZaBfDhC11K86uz2 Wiw0u+ii/FT03jDV+mco5oaouJ/hXFp7uekVFug3PIj7/HtO/gqmVp/Aw7jlmM7C4Qrk EGZIIXr4BuDozmEU4FEqrk3+tKF/eLf1Qy5a05uIOZ41ffBgf9sDk5HA2TqNn+FgD6V/ XlaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=30bJHSBJbpDojxSc0bSme4rbVD4wjZrPn7xS0gwYbsc=; b=F+sVvmhd/ukemPlaKkK2Co86AVKYd3zRFBOYbZfunbNXR5E9mhHBX6skTSPFI/FwWx A0AolNDlYk0NubG5lRbEPpBkItnOJSOezevdqnjHh/k3PGZonXf97qN5RdZHo+GF+CxB 9tweoM3gfDo7QneZOG+DcyCkcFBA0z1g084qdAp/XYNRypT0HHIOtJg5MkRtyZuq8WcX eECVdWnyJix8nIVL8QsWHfSprFKz5JjDz6oNzmbkQK7yy3KV9nNpN99uQ2M6Hq2pXyFU eGnebAQR/WhRRVhGGedKE7KzxQr1T/kFlpm7VpwiG6ebwcm27DEODsyGcJ346a7xLsth mXOQ== X-Gm-Message-State: APt69E0MyEhLZ8Z4w1JQT8cbCVAymKYAvjYdY8pOitof3Mxjpr+sS7Oh bp/pgfJ7SIH3oif2u+OaxXzxQkPjBYpRmseX5sBepQ== X-Google-Smtp-Source: ADUXVKKNg6ocUCm0HYG/34o6+IOhqei9vHvytR3v7M0hlSvzmQpkHHscSCkpDTqfX/+WqhRM+v1yx+y0U4/MLbNozoc= X-Received: by 2002:a24:fe46:: with SMTP id w67-v6mr2088695ith.22.1528979217735; Thu, 14 Jun 2018 05:26:57 -0700 (PDT) MIME-Version: 1.0 References: <1527707719.3469997.1390875592.73AD29B6@webmail.messagingengine.com> <20180530202349.GA10754@osmium.lan> In-Reply-To: From: Bengt Brodersen Date: Thu, 14 Jun 2018 14:26:46 +0200 Message-ID: Subject: Re: [Bug] Strange Globing Behaviour when used with sudo To: Phil Pennock Cc: Daniel Shahaf , Bart Schaefer , zsh-workers@zsh.org Content-Type: multipart/alternative; boundary="0000000000002469d5056e9937fa" --0000000000002469d5056e9937fa Content-Type: text/plain; charset="UTF-8" Any news on this? On Wed, 30 May 2018 at 22:49 Bengt Brodersen wrote: > Just found a paragraph in stat(2) manpage on macos > > _DARWIN_FEATURE_64_BIT_INODE > In order to accommodate advanced capabilities of newer file systems, > the struct stat, struct statfs, and struct dirent data structures were > updated in Mac OSX 10.5. > > The most obvious change is the increased size of ino_t from 32 bits > to 64 bits. As a consequence, storing an ino_t in an int is no longer > safe, and file formats storing ino_t as 32-bit values may need to be > updated. There are other changes as well, such as the widening of > f_fstypename, f_mntonname, and f_mntfromname in struct statfs. Please > refer to stat(2) and dir(5) for more detail on the specific changes to > the other affected data structures. > > On platforms that existed before these updates were available, ABI > compatibility is achieved by providing two implementations for related > functions: one using the legacy data structures and one using the > updated data structures. Variants which make use of the newer > structures have their symbols suffixed with $INODE64. These $INODE64 > suffixes are automatically appended by the compiler tool-chain and should > not be used directly. > > Platforms that were released after these updates only have the newer > variants available to them. These platforms have the macro > _DARWIN_FEATURE_ONLY_64_BIT_INODE defined. > > The _DARWIN_FEATURE_64_BIT_INODE macro should not be set directly. > Instead, developers should make use of the _DARWIN_NO_64_BIT_INODE or > _DARWIN_USE_64_BIT_INODE macros when the default variant is not > desired. The following table details the effects of defining these > macros for different deployment targets. > > > _DARWIN_FEATURE_ONLY_64_BIT_INODE not defined > > -------------------------+------------------------------- > > | Deployment Target > > user defines: | < 10.5 10.5 > 10.5 > > -------------------------+------------------------------- > > (none) | 32-bit 32-bit 64-bit > > _DARWIN_NO_64_BIT_INODE | 32-bit 32-bit 32-bit > > _DARWIN_USE_64_BIT_INODE | 32-bit 64-bit 64-bit > > -------------------------+------------------------------- > > > _DARWIN_FEATURE_ONLY_64_BIT_INODE defined > > -------------------------+------------------------------- > > user defines: | Any Deployment Target > > -------------------------+------------------------------- > > (none) | 64-bit-only > > _DARWIN_NO_64_BIT_INODE | (error) > > _DARWIN_USE_64_BIT_INODE | 64-bit-only > > -------------------------+------------------------------- > > 32-bit 32-bit inode values are enabled, and the legacy > structures involving the ino_t type are in use. The macro > _DARWIN_FEATURE_64_BIT_INODE is not defined. > > 64-bit 64-bit inode values are enabled, and the expanded > structures involving the ino_t type are in use. The macro > _DARWIN_FEATURE_64_BIT_INODE is defined, and loader symbols will contain the > $INODE64 suffix. > > 64-bit-only Like 64-bit, except loader symbols do not have the > $INODE64 suffix. > > (error) A compile time error is generated. > > Due to the increased benefits of the larger structure, it is highly > recommended that developers not define _DARWIN_NO_64_BIT_INODE and make use > of _DARWIN_USE_64_BIT_INODE when targeting Mac OSX 10.5. > > In addition to the $INODE64 suffixed symbols, variants suffixed with > 64 are also available for related functions. These functions were provided > as a way for developers to use the updated structures in code > that also made use of the legacy structures. The enlarged stat > structures were also prefixed with 64 to distinguish them from their legacy > variants. These functions have been deprecated and should be > avoided. > > On Wed, 30 May 2018 at 22:44 Bengt Brodersen > wrote: > >> If you google *mac stat64 deprecated* you will get a lot of results. >> So maybe it caused by the depreciation on darwin os >> >> On Wed, 30 May 2018 at 22:24 Phil Pennock < >> zsh-workers+phil.pennock@spodhuis.org> wrote: >> >>> On 2018-05-30 at 19:15 +0000, Daniel Shahaf wrote: >>> > > On Wed, May 30, 2018 at 10:11 AM, Bengt Brodersen >>> > > > sudo zsh -c 'echo ./*/' >>> > > >>> ./file/ ./folder/ >>> >>> > - macOS 10.13.4 (17E202) >>> > - zsh 5.5.1 (x86_64-apple-darwin17.5.0) >>> > >>> > and that the issue still occurred under -fc. >>> >>> This appears to be macOS returning different results for stat64() for >>> root vs non-root. Using dtruss: >>> >>> non-root: >>> open_nocancel("./\0", 0x1100004, 0x10040A3F8) = 3 0 >>> fstatfs64(0x3, 0x7FFF5F8A1338, 0x10040A3F8) = 0 0 >>> getdirentries64(0x3, 0x7FA30F805E00, 0x1000) = 112 0 >>> getdirentries64(0x3, 0x7FA30F805E00, 0x1000) = 0 0 >>> close_nocancel(0x3) = 0 0 >>> stat64("./dummy/.\0", 0x7FFF5F8A1948, 0x1000) = -1 Err#20 >>> stat64("./folder/.\0", 0x7FFF5F8A1948, 0x1000) = 0 0 >>> >>> root: >>> open_nocancel("./\0", 0x1100004, 0x10B5F8B28) = 3 0 >>> fstatfs64(0x3, 0x7FFF547471B8, 0x10B5F8B28) = 0 0 >>> getdirentries64(0x3, 0x7FAFD9821400, 0x1000) = 112 0 >>> getdirentries64(0x3, 0x7FAFD9821400, 0x1000) = 0 0 >>> close_nocancel(0x3) = 0 0 >>> stat64("./dummy/.\0", 0x7FFF547477C8, 0x1000) = 0 0 >>> stat64("./folder/.\0", 0x7FFF547477C8, 0x1000) = 0 0 >>> >>> defines ENOTDIR as 20. >>> >>> -Phil >>> >> --0000000000002469d5056e9937fa--