From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17866 invoked by alias); 30 May 2018 20:49:47 -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: 42897 Received: (qmail 9526 invoked by uid 1010); 30 May 2018 20:49:47 -0000 X-Qmail-Scanner-Diagnostics: from mail-io0-f196.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.223.196):SA:0(-3.6/5.0):. Processed in 0.894878 secs); 30 May 2018 20:49:47 -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=-3.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,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=vq78YXa3SfEWspITaA0j6XJw8b4CTMgfcH2D1qhAbAY=; b=dHKIOfMltQiM/9pJW/j+sX1jCvS+g1rbhLc+q/gv1W6LEYPKFaT5HALSqrw5W6Nzlv f86ALX/vJt517ifpOVjluDS93uC+cQm6rmNL81xCQros/z7f8Hpf4lDlvmZfJrYfib0a X2WIf9uIa1E/L6n1jMinyDZK+m8jIohOpOxiGMJP3Fn661f8JZIL0XqlDtNdjxQuH8Ck gWqVX8kxuIsnxfrsic/fhh/SiOvJrG1ez6cqw41JG5EbTB6Nbzj+v8Fx1fOVpKXBN3bE 62N2Ht9CRdFGVNdejQ0cajYjEkZcmgSoWH+Phs3nznomAy3mnwGEg7LUfsz6JAjc2FHn 2MOA== 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=vq78YXa3SfEWspITaA0j6XJw8b4CTMgfcH2D1qhAbAY=; b=pMeAOIvAOH9QwMuUi7PtqOxHeRirh7vn8shrZWcrWQCYoqpvadTEn2wPBz3fEULQQ5 +rIFGUNWqG9b8Qd81LD3BEE/LS3+wJQzS4/uy6egzcaU2DAIE8/+gtFKjGrwd+F0ag7N 3cG/itmexm0mUa7M+GkvOUkd5zvm94YzLc1tKp4UbtVNAJYok4HmHJzEBItnlBph0qON bDUknmZJHI+6sJeD5mBMTvU5NfRW174Br6r/gho+swos4FeoyoESUq5p1T3TWiH4ZSaQ JJSwCR8gWCTrc3cpPDHN2iOSMqoUN0Nsr8xbZTEuW30HaDI8VuXGXHDoFuJoJ7nUa2i9 yMaA== X-Gm-Message-State: ALKqPwd4+oBi7ZHMFSwoRu0W3vcCUMq60kgBhwRqHaBb89nepgh+ugn5 B36mYL17fzNRAlJ01XGQMgM54G33HAZHKw4fYaoFdQ== X-Google-Smtp-Source: ADUXVKJkmlp4teH7iLHlDLK+Wg5BRxHI+Of09K0RdrJAJBrTMiKkP0yTrBeQLOepezGxJwKc4OcYN3RmPDQlK1k2+EI= X-Received: by 2002:a5e:c801:: with SMTP id y1-v6mr3709640iol.128.1527713383791; Wed, 30 May 2018 13:49:43 -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: Wed, 30 May 2018 22:49:32 +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="0000000000008f41ef056d727d80" --0000000000008f41ef056d727d80 Content-Type: text/plain; charset="UTF-8" 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 >> > --0000000000008f41ef056d727d80--