Ensure the CWD precedes PROFILE_HOME in new CDPATH.
authorIain Patterson <me@iain.cx>
Tue, 2 Dec 2014 13:48:39 +0000 (13:48 +0000)
committerIain Patterson <me@iain.cx>
Thu, 11 Feb 2016 13:09:16 +0000 (13:09 +0000)
commit92baf2b71dfac31f0d2204eff97faca94c3f4b2e
tree6501b584104e742f81f5459cc3c7c748cb675d01
parent133454752bb2482551a770ff3762ff3d009073c4
Ensure the CWD precedes PROFILE_HOME in new CDPATH.

If CDPATH was set to PROFILE_HOME, as was the case when becoming a user
with no default CDPATH, we would end up in the unexpected situation of
typing, say, "cd .ssh" from the target user's home directory but
actually changing to the profile user's .ssh directory.

The new logic for CDPATH is as follows:

Do nothing if CDPATH already contains PROFILE_HOME.
Otherwise set it to . if empty then unconditionally append PROFILE_HOME.
.profile.d/cdpath.bashrc