mirror of
https://github.com/troglobit/finit.git
synced 2026-11-23 20:11:44 +00:00
Merge pull request #465 from aanderse/master
Set USER and LOGNAME environment variables when dropping privileges
This commit is contained in:
1 file changed
+4
-1
+4
-1
@@ -627,8 +627,11 @@ static pid_t service_fork(svc_t *svc)
|
|||||||
set_uid(uid, svc);
|
set_uid(uid, svc);
|
||||||
|
|
||||||
/* Set default path for regular users */
|
/* Set default path for regular users */
|
||||||
if (uid > 0)
|
if (uid > 0) {
|
||||||
setenv("PATH", _PATH_DEFPATH, 1);
|
setenv("PATH", _PATH_DEFPATH, 1);
|
||||||
|
setenv("USER", svc->username, 1);
|
||||||
|
setenv("LOGNAME", svc->username, 1);
|
||||||
|
}
|
||||||
if (home) {
|
if (home) {
|
||||||
setenv("HOME", home, 1);
|
setenv("HOME", home, 1);
|
||||||
if (chdir(home)) {
|
if (chdir(home)) {
|
||||||
|
|||||||
Reference in new issue
Block a user