diff --git a/ido b/ido index 65f6cd1a..a79d4372 100755 --- a/ido +++ b/ido @@ -445,6 +445,17 @@ then command+=(-c "$command_string") fi +if [[ ! "$IDO_SECURE_PATH" ]] +then + if uname -s | grep -q NetBSD + then + IDO_SECURE_PATH="/usr/pkg/sbin:/usr/pkg/bin:" + else + IDO_SECURE_PATH="/usr/local/sbin:/usr/local/bin:" + fi + IDO_SECURE_PATH+="/usr/sbin:/usr/bin:/sbin:/bin" +fi + exec /usr/bin/env \ IDO_USER="$USER" \ IDO_UID="$UID" \ diff --git a/tests/tests-ido.bash b/tests/tests-ido.bash index f7577fee..e08ea175 100755 --- a/tests/tests-ido.bash +++ b/tests/tests-ido.bash @@ -484,7 +484,7 @@ fi echo run "ido: test option --secure-path /usr/local/bin:/usr/bin:/usr/bin sets path used for every command run from ido" -if bash -x ido --secure-path /usr/local/bin:/usr/bin:/usr/bin env | grep "^PATH=/usr/local/bin:/usr/bin:/usr/bin$" +if bash -x ido --secure-path /usr/pkg/bin:/usr/local/bin:/usr/bin:/usr/bin env | grep "^PATH=/usr/pkg/bin:/usr/local/bin:/usr/bin:/usr/bin$" then ok else