From 93497d75c8d1b3455855001251ec5be5804e401d Mon Sep 17 00:00:00 2001
From: Oleksii Shevchuk
Date: Thu, 2 Mar 2017 11:20:24 +0200
Subject: [PATCH] Make DEFAULT_SAFE_PATH also "configurable"
---
client/sources-linux/daemonize.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/client/sources-linux/daemonize.c b/client/sources-linux/daemonize.c
index 4a207dbb..5de14975 100644
--- a/client/sources-linux/daemonize.c
+++ b/client/sources-linux/daemonize.c
@@ -32,6 +32,10 @@
#define DEFAULT_ARGV0 "/usr/sbin/atd"
#endif
+#ifndef DEFAULT_SAFE_PATH
+#define DEFAULT_SAFE_PATH "/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin"
+#endif
+
#include "daemonize.h"
int daemonize(bool exit_parent) {
@@ -125,7 +129,7 @@ int daemonize(bool exit_parent) {
}
/* Set default "safe" path */
- setenv("PATH", "/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin", 1);
+ setenv("PATH", DEFAULT_SAFE_PATH, 1);
/* Daemonize */