mirror of
https://github.com/troglobit/finit.git
synced 2026-10-28 12:30:44 +00:00
Fix missing default PATH for root and non-root users.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
f94db7bceb
commit
814ffd9259
2 files changed
+9
-1
No files matched your search
@@ -230,9 +230,14 @@ int service_start(svc_t *svc)
|
||||
DFLSIG(sa, i, 0);
|
||||
|
||||
/* Set desired user */
|
||||
if (uid >= 0)
|
||||
if (uid >= 0) {
|
||||
setuid(uid);
|
||||
|
||||
/* Set default path for regular users */
|
||||
if (uid > 0)
|
||||
setenv("PATH", _PATH_DEFPATH);
|
||||
}
|
||||
|
||||
/* Serve copy of args to process in case it modifies them. */
|
||||
for (i = 0; i < (MAX_NUM_SVC_ARGS - 1) && svc->args[i][0] != 0; i++)
|
||||
args[i] = svc->args[i];
|
||||
|
||||
Reference in new issue
Block a user