Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PSA: Mac OS X El Capitan upgrade might break your $PATH
- X-seq: zsh-users 20379
- From: Andrew Janke <andrew@xxxxxxxxxxx>
- To: Kurtis Rader <krader@xxxxxxxxxxxxx>
- Subject: Re: PSA: Mac OS X El Capitan upgrade might break your $PATH
- Date: Fri, 31 Jul 2015 18:29:17 -0400
- Cc: Mikael Magnusson <mikachu@xxxxxxxxx>, Zsh Users <zsh-users@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=nIFti1B99UUu8vEYOhCmFuYB0Ac=; b=WSJDk V/IqhH/5a4KBDTf8jdO4qRqC5S9lmYI5F6LZ7pJBoDbr8nanMq+nykt11vdg1eHg h9IHM9sg1WtDrRKnj4yg+yincMtbSfa70j7tFU12Jrenr3SiFfaqgdYjh5V2p2G4 rFoZ4d6IoyBf2ZEQdorsp40E4BnSX35uzAJTG8=
- In-reply-to: <CABx2=D9g-8k5pJvsJ1CXVbOEfN5M5+BHTvtzRYqJo894HHJBAg@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CABx2=D-TXjJpoN8pQOR6nswM4J3xxwgm8aoFn8ZyE-o2DZw9pQ@mail.gmail.com> <CAHYJk3S-W_FYWEidfhC_g62=8B3hRLoyGnnOQsJcy4FPp9Ct5g@mail.gmail.com> <55BBE31C.5050909@apjanke.net> <CABx2=D9g-8k5pJvsJ1CXVbOEfN5M5+BHTvtzRYqJo894HHJBAg@mail.gmail.com>
On 7/31/15 6:01 PM, Kurtis Rader wrote:
On Fri, Jul 31, 2015 at 2:05 PM, Andrew Janke <andrew@xxxxxxxxxxx
<mailto:andrew@xxxxxxxxxxx>> wrote:
I suspect the order of entries in path_helper is determined by
alphabetical ordering of the filenames in /etc/paths.d, where
path_helper locates the files that come after the default system
paths. That "40-" in XQuartz looks like an rcdir-style technique
to enforce ordering, and I think the XQuartz folks know what
they're doing with the OS X system stuff. (This is on 10.9.)
That would be fine if it simply appended those directories in that
order to the existing PATH as the man page claims. But it is clearly
using a hash based ordering and ignoring even the apparent ordering
implied by the file names in /etc/paths.d. From my system:
14:45 macbook coff ~ ls /etc/paths.d
40-XQuartzgo
14:50 macbook coff ~ cat /etc/paths.d/*
/opt/X11/bin
/usr/local/go/bin
14:52 macbook coff ~ /usr/libexec/path_helper -s
PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/go/bin:/Users/krader/bin:/Users/krader/sbin:/Users/krader/symlinks:/usr/local/sbin";
export PATH;
14:52 macbook coff ~ echo $PATH
/Users/krader/bin:/Users/krader/sbin:/Users/krader/symlinks:/usr/local/bin:/usr/local/go/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/opt/X11/bin
That path_helper output doesn't look random or hash based. That looks like:
- the system default paths (from /etc/paths) come first, in the order
specified in /etc/paths
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:
- then the stuff from /etc/paths.d, in filename alphabetical order
/opt/X11/bin:/usr/local/go/bin:
- then any other item it found in $PATH at the time of its invocation,
in the order in which they appeared in $PATH.
/Users/krader/bin:/Users/krader/sbin:/Users/krader/symlinks:/usr/local/sbin
That lastpart isn't documented in `man path_helper`, but it behaved this
way consistently when I was testing it with various $PATH values. (on 10.9)
The man page could stand tobe more thorough and clear, but I don't think
it's randomly rearranging your path. And the `man path_helper` page does
indicate where the default paths come from, though it's buried a few
paragraphs down.
Prior to reading these directories, default PATH and MANPATH
values are
obtained from the files /etc/paths and /etc/manpaths respectively.
One other El Capitan change: the system-supplied zsh (5.0.8)
appears to be compiled with /usr/local/share/zsh/site-functions in
the default $fpath, which was not the case for earlier versions of
OS X. This is probably related to the "rootless" stuff that locks
down /usr outside /usr/local/.
Yes, I noticed that as well and should have mentioned it as it causes
zsh running as root to complain about "compinit: insecure files" since
those files are managed by HomeBrew and owned by me.
Computer Security: If it isn't getting in your way you're doing it
wrong :-)
--
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
Messages sorted by:
Reverse Date,
Date,
Thread,
Author