Skip to content

Commit 9b2c73d

Browse files
CopilotMossaka
andcommitted
fix: address code review feedback for isolate.sh
Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
1 parent f9f9d11 commit 9b2c73d

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

containers/agent/isolate.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
# - chroot provides process-level isolation when running host binaries
1717
# - All commands run as non-root user (awfuser) after capability drop
1818

19-
set -e
19+
# Note: We intentionally do NOT use 'set -e' here to allow graceful fallback
20+
# through multiple command resolution strategies without exiting on first failure
2021

2122
# Get the command to execute (first argument)
2223
COMMAND="$1"
@@ -39,8 +40,8 @@ if [ ! -d /host ]; then
3940
exec "$@"
4041
fi
4142

42-
# Check if this is an absolute path
43-
if [[ "$COMMAND" == /* ]]; then
43+
# Check if this is an absolute path (POSIX-compliant test)
44+
if [ "${COMMAND#/}" != "$COMMAND" ]; then
4445
# Absolute path - check if it exists in /host
4546
HOST_PATH="/host${COMMAND}"
4647
if [ -x "$HOST_PATH" ]; then

0 commit comments

Comments
 (0)