zsh treats an empty PATH component ("::") as ".", which creates a
security hole. Sanitize PATH by explicitly removing empty
components.
As agreed on #grml, root's PATH should also list /usr/local/sbin
and /usr/local/bin before /sbin, /bin, /usr/sbin and /usr/bin;
and there is no harm in adding $HOME/bin unconditionally as the
first PATH component.
+ $HOME/bin
+ /usr/local/sbin
+ /usr/local/bin
/sbin
/bin
/usr/sbin
/usr/bin
/sbin
/bin
/usr/sbin
/usr/bin
- /usr/local/sbin
- /usr/local/bin
"${ADDONS}"
"${path[@]}"
)
fi
"${ADDONS}"
"${path[@]}"
)
fi
+# remove empty components to avoid '::' ending up + resulting in './' being in $PATH
+path=( "${path[@]:#}" )
+
typeset -U path
# less (:=pager) options:
typeset -U path
# less (:=pager) options: