Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/exec_ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -1489,6 +1489,7 @@ script_matches(const char *script, const char *execpath, int argc,
char magic[2];
int count;
FILE *fp = NULL;
bool matched = false;
ssize_t len;
debug_decl(get_interpreter, SUDO_DEBUG_EXEC);

Expand Down Expand Up @@ -1557,6 +1558,7 @@ script_matches(const char *script, const char *execpath, int argc,
continue;
}
}
goto done;
}
if (argc > 1 && interp_args != NULL) {
if (strcmp(interp_args, argv[1]) != 0) {
Expand All @@ -1568,14 +1570,15 @@ script_matches(const char *script, const char *execpath, int argc,
argv++;
}
argv++;
matched = true;
break;
}

done:
free(line);
if (fp != NULL)
fclose(fp);
debug_return_int((int)(argv - orig_argv));
debug_return_int(matched ? (int)(argv - orig_argv) : 0);
}

static ssize_t
Expand Down
Loading