Check for existence of the ExtraScript 95/239995/2
authorKarol Lewandowski <k.lewandowsk@samsung.com>
Fri, 31 Jul 2020 10:03:07 +0000 (12:03 +0200)
committerKarol Lewandowski <k.lewandowsk@samsung.com>
Fri, 31 Jul 2020 10:04:56 +0000 (12:04 +0200)
In the case where ExtraScript points to non-existent script, the crash worker
will create child process which will remain zombie until it's reaped.  The
reaping is handled after dump_systemstate finishes.  This will cause zombie
process to exist for duration of dump_systemstate execution.

This change prevents creating child process if ExtraScripts points to path
which is not executable.

Change-Id: I4caba47812b6990e9b5b54fe9929930cc667f4eb

src/crash-manager/crash-manager.c

index 902f246..b465cdd 100644 (file)
@@ -606,7 +606,7 @@ end:
 
 static bool extra_script(const struct crash_info *cinfo, pid_t *pid)
 {
-       if (!config.extra_script)
+       if (!config.extra_script || access(config.extra_script, X_OK))
                return false;
 
        char pid_str[11];