From 770a2582de13a876790f1de35317d6c3d3347b23 Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Sat, 7 May 2022 14:50:31 +0200 Subject: [PATCH] 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 --- src/postfork.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/postfork.cpp b/src/postfork.cpp index 9d78351a3..84f2e101e 100644 --- a/src/postfork.cpp +++ b/src/postfork.cpp @@ -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 "