public
/
FUZIX.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4da1e1c
)
init: set groups on L2 system
author
Alan Cox
<alan@linux.intel.com>
Fri, 25 Mar 2016 20:20:57 +0000
(20:20 +0000)
committer
Alan Cox
<alan@linux.intel.com>
Fri, 25 Mar 2016 20:20:57 +0000
(20:20 +0000)
Applications/util/init.c
patch
|
blob
|
history
diff --git
a/Applications/util/init.c
b/Applications/util/init.c
index
7751a86
..
c5631c7
100644
(file)
--- a/
Applications/util/init.c
+++ b/
Applications/util/init.c
@@
-22,6
+22,7
@@
#include <fcntl.h>
#include <pwd.h>
#include <utmp.h>
+#include <grp.h>
#include <errno.h>
#include <paths.h>
#include <sys/wait.h>
@@
-742,6
+743,8
@@
static void spawn_login(struct passwd *pwd, const char *tty, const char *id)
/* Don't leak utmp into the child */
endutent();
+ if (initgroups(pwd->pw_name, pwd->pw_gid) == -1 && errno != ENOSYS)
+ exit(255);
if (setgid(pwd->pw_gid) == -1 ||
setuid(pwd->pw_uid) == -1)
_exit(255);