.bin, .profile: Update, add minor security checks to PATH patching
This commit is contained in:
parent
d6beb3dd37
commit
7b9b201d8f
2
.bin
2
.bin
@ -1 +1 @@
|
|||||||
Subproject commit aa1cc36264073fdf43cff7fe740844356e9ef0fe
|
Subproject commit 2d62cfabbf1b226e173b7e20a1d49edba820b7be
|
7
.profile
7
.profile
@ -25,7 +25,12 @@
|
|||||||
_baseshell="$(basename -- "$0")"
|
_baseshell="$(basename -- "$0")"
|
||||||
|
|
||||||
# Patch PATH
|
# Patch PATH
|
||||||
desiredpath="/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/usr/local/games:/usr/games:$HOME/.bin:$HOME/.local/bin"
|
desiredpath="/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/usr/local/games:/usr/games"
|
||||||
|
for dir in "$HOME/.bin" "$HOME/.local/bin"; do
|
||||||
|
if [ -d "$dir" ] && [ -O "$dir" ]; then
|
||||||
|
desiredpath="$desiredpath:$dir"
|
||||||
|
fi
|
||||||
|
done
|
||||||
IFS=":"
|
IFS=":"
|
||||||
for path in $desiredpath; do
|
for path in $desiredpath; do
|
||||||
PATH="${PATH#*$path}"
|
PATH="${PATH#*$path}"
|
||||||
|
Loading…
Reference in New Issue
Block a user