Skip to content

Commit

Permalink
ido: fix PATH on NetBSD
Browse files Browse the repository at this point in the history
This fixes commit 4f627af.

Fixes:

	Running ido: test environment is not preserved...
	env: bash: No such file or directory
	ido: test environment is not preserved: [OK]
  • Loading branch information
gportay committed Nov 24, 2024
1 parent 91bd6f3 commit f1c5aaa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions ido
Original file line number Diff line number Diff line change
Expand Up @@ -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" \
Expand Down
2 changes: 1 addition & 1 deletion tests/tests-ido.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f1c5aaa

Please sign in to comment.