zsh-workers
 help / color / mirror / code / Atom feed
From: Bengt Brodersen <bengt.brodersen@gmail.com>
To: Phil Pennock <zsh-workers+phil.pennock@spodhuis.org>
Cc: Daniel Shahaf <d.s@daniel.shahaf.name>,
	Bart Schaefer <schaefer@brasslantern.com>,
	 zsh-workers@zsh.org
Subject: Re: [Bug] Strange Globing Behaviour when used with sudo
Date: Thu, 14 Jun 2018 14:26:46 +0200	[thread overview]
Message-ID: <CAMaoPXxddLz6F1wzV-U+Y2ZPoSTqCLvE=McwseLtiEZZkrb3qA@mail.gmail.com> (raw)
In-Reply-To: <CAMaoPXwFdVPszgra5busqtLNqAKsJxDV56LPW9ZrtUbg=tbSMQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 5923 bytes --]

Any news on this?

On Wed, 30 May 2018 at 22:49 Bengt Brodersen <bengt.brodersen@gmail.com>
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@gmail.com>
> 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
>>>
>>> <sys/errno.h> defines ENOTDIR as 20.
>>>
>>> -Phil
>>>
>>

  parent reply	other threads:[~2018-06-14 12:27 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-30 17:11 Bengt Brodersen
2018-05-30 18:06 ` Bart Schaefer
2018-05-30 19:15   ` Daniel Shahaf
2018-05-30 20:23     ` Phil Pennock
2018-05-30 20:44       ` Bengt Brodersen
2018-05-30 20:49         ` Bengt Brodersen
2018-05-31  8:44           ` Peter Stephenson
     [not found]           ` <20180531094403.05b62bee@camnpupstephen.cam.scsc.local>
2018-05-31  8:49             ` Peter Stephenson
2018-05-31 11:39               ` Jun T
2018-05-31 15:29                 ` Peter Stephenson
2018-05-31 18:15                   ` Daniel Tameling
2018-06-01 14:08                     ` Jun T.
2018-06-02 18:17                       ` Daniel Tameling
2018-06-03 16:30                         ` Jun T.
2018-06-03 18:48                           ` Daniel Tameling
2018-06-03 19:17                             ` dana
2018-06-04  1:23                               ` Jun T
2018-06-04 12:48                           ` Jun T
2018-06-14 12:26           ` Bengt Brodersen [this message]
2018-05-31  6:37       ` Martijn Dekker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAMaoPXxddLz6F1wzV-U+Y2ZPoSTqCLvE=McwseLtiEZZkrb3qA@mail.gmail.com' \
    --to=bengt.brodersen@gmail.com \
    --cc=d.s@daniel.shahaf.name \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-workers+phil.pennock@spodhuis.org \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).