Give special error for when file failed to execute but is executable

This is after we've tried to find the interpreter, so we would already
have complained about e.g. /usr/bin/pthyon not existing.

Realistically the most common case here is things that don't start
with a shebang like ELFs. Writing special extraction code here is
overkill, and I can't see a good function to do it for us.

But this should point you in the right direction.

Fixes #8938
This commit is contained in:
Fabian Homborg 2022-05-07 14:50:31 +02:00
parent e3c6cbaaa6
commit 770a2582de

View file

@ -469,6 +469,10 @@ void safe_report_exec_error(int err, const char *actual_cmd, const char *const *
"executable command.",
actual_cmd, interpreter);
}
} else if (access(actual_cmd, X_OK) == 0) {
FLOGF_SAFE(exec,
"Failed to execute process '%s': The file exists and is executable. Check the interpreter or linker?",
actual_cmd);
} else {
FLOGF_SAFE(exec,
"Failed to execute process '%s': The file does not exist or could not "