mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-03 23:28:57 +00:00
Revoke properly by setgid, not by setuid, overlooked in games
uid->gid change
This commit is contained in:
parent
554cf12897
commit
9ea04b5811
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=29825
@ -47,6 +47,8 @@
|
||||
static char sccsid[] = "@(#)input.c 8.1 (Berkeley) 5/31/93";
|
||||
#endif not lint
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "include.h"
|
||||
#include "pathnames.h"
|
||||
|
||||
@ -319,9 +321,10 @@ gettoken()
|
||||
#endif
|
||||
if (fork() == 0) /* child */
|
||||
{
|
||||
char *shell, *base, *getenv(), *strrchr();
|
||||
char *shell, *base;
|
||||
|
||||
setuid(getuid()); /* turn off setuid bit */
|
||||
/* revoke */
|
||||
setgid(getgid());
|
||||
done_screen();
|
||||
|
||||
/* run user's favorite shell */
|
||||
|
Loading…
Reference in New Issue
Block a user