Make DEFAULT_SAFE_PATH also "configurable"

This commit is contained in:
Oleksii Shevchuk 2017-03-02 11:20:24 +02:00 committed by Oleksii Shevchuk
parent a31537968c
commit 93497d75c8
1 changed files with 5 additions and 1 deletions

View File

@ -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 */