Revoke properly by setgid, not by setuid, overlooked in games

uid->gid change
This commit is contained in:
Andrey A. Chernov 1997-09-24 21:29:58 +00:00
parent 554cf12897
commit 9ea04b5811
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=29825

View File

@ -47,6 +47,8 @@
static char sccsid[] = "@(#)input.c 8.1 (Berkeley) 5/31/93"; static char sccsid[] = "@(#)input.c 8.1 (Berkeley) 5/31/93";
#endif not lint #endif not lint
#include <stdlib.h>
#include <string.h>
#include "include.h" #include "include.h"
#include "pathnames.h" #include "pathnames.h"
@ -319,9 +321,10 @@ gettoken()
#endif #endif
if (fork() == 0) /* child */ if (fork() == 0) /* child */
{ {
char *shell, *base, *getenv(), *strrchr(); char *shell, *base;
setuid(getuid()); /* turn off setuid bit */ /* revoke */
setgid(getgid());
done_screen(); done_screen();
/* run user's favorite shell */ /* run user's favorite shell */