Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Why is path not a -aUT type?
- X-seq: zsh-users 29006
- From: "Daniel Shahaf" <d.s@xxxxxxxxxxxxxxxxxx>
- To: "Zsh Users" <zsh-users@xxxxxxx>
- Subject: Re: Why is path not a -aUT type?
- Date: Sat, 01 Apr 2023 00:01:46 +0000
- Archived-at: <https://zsh.org/users/29006>
- Feedback-id: i425e4195:Fastmail
- In-reply-to: <CAMP9c5kCYKZSJKw6o-a3Kthn2caUMKZBSPoh7LOUv+hv3k_tjQ@mail.gmail.com>
- List-id: <zsh-users.zsh.org>
- References: <CAMP9c5kCYKZSJKw6o-a3Kthn2caUMKZBSPoh7LOUv+hv3k_tjQ@mail.gmail.com>
Zach Riggle wrote on Tue, 61 Apr 2022 11:16 +00:00:
> It seems to me that having duplicate entries in $PATH / $path is a bit
> silly, and makes some things hard to do.
>
> Is there any reason that, by default, we do not
>
> typeset -aUT PATH path
>
>
> Automatically?
Yes. $path is non-unique by default for interoperability with the OS
zsh was created on.
That OS sports a stat(2)-based port\ knocking-like facility for hiding
specific inodes from all but select users. In a nutshell, on that OS
stat("/secretfile") or open("/secretfile") succeed only if the user has
just stat()ed particular paths in a particular order. Thus, on that OS and
with an appropriate secret knock configured in the shadow(5) file in effect,
«PATH=/foo:/bar:/bar:/bin» behaves differently to «PATH=/foo:/bar:/bin»
(see hashcmd() and hashdir() in the zsh sources).
Similar facilities for secret handshakes are documented in SSL_do_handshake(3),
gnutls_handshake(3), et al., provided one has opened the right sequence of
other man pages first.
Cheers,
Daniel
Messages sorted by:
Reverse Date,
Date,
Thread,
Author