diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2002-09-05 00:21:25 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2002-09-05 00:21:25 +0000 |
commit | 6c8cf6646e21353ae497c6f63697a209f16ae08b (patch) | |
tree | 8ddb7327de3ae05bc41c7609e101a74a478ae658 /libexec/rpc.rwalld/rwalld.c | |
parent | dbb61ca6f8a79e5507a476ef811ad6c02d0ce83c (diff) |
kill groups too when we revoke privs
Diffstat (limited to 'libexec/rpc.rwalld/rwalld.c')
-rw-r--r-- | libexec/rpc.rwalld/rwalld.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/libexec/rpc.rwalld/rwalld.c b/libexec/rpc.rwalld/rwalld.c index 77b84ba8912..e83aefb13d5 100644 --- a/libexec/rpc.rwalld/rwalld.c +++ b/libexec/rpc.rwalld/rwalld.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rwalld.c,v 1.7 2002/06/28 01:04:15 deraadt Exp $ */ +/* $OpenBSD: rwalld.c,v 1.8 2002/09/05 00:21:24 deraadt Exp $ */ /* * Copyright (c) 1993 Christopher G. Demetriou @@ -30,7 +30,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: rwalld.c,v 1.7 2002/06/28 01:04:15 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: rwalld.c,v 1.8 2002/09/05 00:21:24 deraadt Exp $"; #endif /* not lint */ #include <sys/types.h> @@ -72,11 +72,14 @@ main(int argc, char *argv[]) SVCXPRT *transp; if (geteuid() == 0) { - struct passwd *pep = getpwnam("nobody"); - - if (pep) { - seteuid(pep->pw_uid); - setuid(pep->pw_uid); + struct passwd *pw = getpwnam("nobody"); + + if (pw) { + setgroups(1, &pw->pw_gid); + setegid(pw->pw_gid); + setgid(pw->pw_gid); + seteuid(pw->pw_uid); + setuid(pw->pw_uid); } else { seteuid(getuid()); setuid(getuid()); |