use setgroups()
git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@42 db0b04b0-f4d1-0310-9a6d-de3e77497b0e
This commit is contained in:
parent
c9ed0149c6
commit
ad799b2374
|
@ -1072,8 +1072,23 @@ main (void)
|
|||
}
|
||||
|
||||
/* shed privs. this is done immediately after chroot. */
|
||||
setgid (newgid);
|
||||
setuid (newuid);
|
||||
if (setgroups(1, &newgid) == -1)
|
||||
{
|
||||
perror("setgroups");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (setgid (1, newgid) == -1)
|
||||
{
|
||||
perror("setgid");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (setuid (1, newuid) == -1)
|
||||
{
|
||||
perror("setuid");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/* simple login routine, uses ncurses */
|
||||
if (readfile (0))
|
||||
|
|
Loading…
Reference in New Issue