Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F163244177
D36148.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
568 B
Referenced Files
None
Subscribers
None
D36148.diff
View Options
diff --git a/usr.sbin/daemon/daemon.c b/usr.sbin/daemon/daemon.c
--- a/usr.sbin/daemon/daemon.c
+++ b/usr.sbin/daemon/daemon.c
@@ -42,6 +42,7 @@
#include <errno.h>
#include <libutil.h>
#include <login_cap.h>
+#include <paths.h>
#include <pwd.h>
#include <signal.h>
#include <stdio.h>
@@ -465,6 +466,10 @@
if (setusercontext(NULL, pw, pw->pw_uid, LOGIN_SETALL) != 0)
errx(1, "failed to set user environment");
+
+ setenv("USER", pw->pw_name, 1);
+ setenv("HOME", pw->pw_dir, 1);
+ setenv("SHELL", *pw->pw_shell ? pw->pw_shell : _PATH_BSHELL, 1);
}
/*
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Jul 22, 9:04 AM (2 h, 38 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35358363
Default Alt Text
D36148.diff (568 B)
Attached To
Mode
D36148: The daemon(8) -u option should set USER, HOME and SHELL environment variables
Attached
Detach File
Event Timeline
Log In to Comment