Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [Bug] Strange Globing Behaviour when used with sudo
- X-seq: zsh-workers 43014
- From: Bengt Brodersen <bengt.brodersen@xxxxxxxxx>
- To: Phil Pennock <zsh-workers+phil.pennock@xxxxxxxxxxxx>
- Subject: Re: [Bug] Strange Globing Behaviour when used with sudo
- Date: Thu, 14 Jun 2018 14:26:46 +0200
- Cc: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>, zsh-workers@xxxxxxx
- 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==
- In-reply-to: <CAMaoPXwFdVPszgra5busqtLNqAKsJxDV56LPW9ZrtUbg=tbSMQ@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAMaoPXzXBv4pAD1_=Lr78h3iT+yhZfSq0CgEs+QMTVeDaR28Vw@mail.gmail.com> <CAH+w=7YxodoKJhA9-xswA5H7vckiHHzFTO_MqR5Ahux0p3h6NQ@mail.gmail.com> <1527707719.3469997.1390875592.73AD29B6@webmail.messagingengine.com> <20180530202349.GA10754@osmium.lan> <CAMaoPXzzuRvAn1FFF3BJ0fnJTiaGgeg2TJKAZgL4RLwV5t5RBw@mail.gmail.com> <CAMaoPXwFdVPszgra5busqtLNqAKsJxDV56LPW9ZrtUbg=tbSMQ@mail.gmail.com>
Any news on this?
On Wed, 30 May 2018 at 22:49 Bengt Brodersen <bengt.brodersen@xxxxxxxxx>
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 <bengt.brodersen@xxxxxxxxx>
> 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@xxxxxxxxxxxx> 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
>>>
>>> <sys/errno.h> defines ENOTDIR as 20.
>>>
>>> -Phil
>>>
>>
Messages sorted by:
Reverse Date,
Date,
Thread,
Author