Blame SOURCES/cronie-1.4.11-inherit-path.patch
|
|
ff87c4 |
diff --git a/src/entry.c b/src/entry.c
|
|
|
ff87c4 |
index 3638207..ce37756 100644
|
|
|
ff87c4 |
--- a/src/entry.c
|
|
|
ff87c4 |
+++ b/src/entry.c
|
|
|
ff87c4 |
@@ -343,8 +343,18 @@ entry *load_entry(FILE * file, void (*error_func) (), struct passwd *pw,
|
|
|
ff87c4 |
e->envp = tenvp;
|
|
|
ff87c4 |
#ifndef LOGIN_CAP
|
|
|
ff87c4 |
/* If login.conf is in used we will get the default PATH later. */
|
|
|
ff87c4 |
- if (ChangePath && !env_get("PATH", e->envp)) {
|
|
|
ff87c4 |
- if (glue_strings(envstr, sizeof envstr, "PATH", _PATH_DEFPATH, '=')) {
|
|
|
ff87c4 |
+ if (!env_get("PATH", e->envp)) {
|
|
|
ff87c4 |
+ char *defpath;
|
|
|
ff87c4 |
+
|
|
|
ff87c4 |
+ if (ChangePath)
|
|
|
ff87c4 |
+ defpath = _PATH_DEFPATH;
|
|
|
ff87c4 |
+ else {
|
|
|
ff87c4 |
+ defpath = getenv("PATH");
|
|
|
ff87c4 |
+ if (defpath == NULL)
|
|
|
ff87c4 |
+ defpath = _PATH_DEFPATH;
|
|
|
ff87c4 |
+ }
|
|
|
ff87c4 |
+
|
|
|
ff87c4 |
+ if (glue_strings(envstr, sizeof envstr, "PATH", defpath, '=')) {
|
|
|
ff87c4 |
if ((tenvp = env_set(e->envp, envstr)) == NULL) {
|
|
|
ff87c4 |
ecode = e_memory;
|
|
|
ff87c4 |
goto eof;
|