Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Why is path not a -aUT type?



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