fix linpeas not getting EC2 metadata

This commit is contained in:
carlospolop
2025-05-18 04:58:22 +02:00
parent 58c107df40
commit ef28ef7a33
2 changed files with 10 additions and 7 deletions

View File

@@ -31,13 +31,10 @@ execBin() {
# ---------------- 120second wallclock timeout ----------------
if command -v timeout >/dev/null 2>&1; then # GNU/BSD timeout
print_info "Running $TOOL_NAME with 120s timeout"
timeout --preserve-status -s 9 120 "$TMP_BIN" $PARAMS
elif command -v gtimeout >/dev/null 2>&1; then # Homebrew coreutils (macOS)
print_info "Running $TOOL_NAME with 120s gtimeout"
gtimeout --preserve-status 120 "$TMP_BIN" $PARAMS
gtimeout --preserve-status -s 9 120 "$TMP_BIN" $PARAMS
else # POSIX fallback
print_info "Running $TOOL_NAME with 120s custom timeout"
(
"$TMP_BIN" $PARAMS & # run in background
cmdpid=$!