[systemd-devel] [PATCH] util: do not execute files without exec permission

Ronny Chevalier chevalier.ronny at gmail.com
Sat Aug 16 05:24:28 PDT 2014


---
 src/shared/util.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/shared/util.c b/src/shared/util.c
index 18d40f3..3a03470 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -3921,6 +3921,10 @@ void execute_directory(const char *directory, DIR *d, usec_t timeout, char *argv
                                 _exit(EXIT_FAILURE);
                         }
 
+                        if (access(path, X_OK) < 0) {
+                                continue;
+                        }
+
                         pid = fork();
                         if (pid < 0) {
                                 log_error("Failed to fork: %m");
-- 
2.0.4



More information about the systemd-devel mailing list