diff options
author | 1996-12-22 03:28:56 +0000 | |
---|---|---|
committer | 1996-12-22 03:28:56 +0000 | |
commit | c34231cb2bc4111e46693ccc65c3a1051916586e (patch) | |
tree | 6f697c7cf74df91db97bbc8301118290b8a574f5 /usr.sbin/pppd/main.c | |
parent | Deal with _POSIX_SAVED_IDS when relinquishing privileges (diff) | |
download | wireguard-openbsd-c34231cb2bc4111e46693ccc65c3a1051916586e.tar.xz wireguard-openbsd-c34231cb2bc4111e46693ccc65c3a1051916586e.zip |
Deal with _POSIX_SAVED_IDS when relinquishing privileges
Diffstat (limited to 'usr.sbin/pppd/main.c')
-rw-r--r-- | usr.sbin/pppd/main.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.sbin/pppd/main.c b/usr.sbin/pppd/main.c index 5ff49361733..374bad88bf7 100644 --- a/usr.sbin/pppd/main.c +++ b/usr.sbin/pppd/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.11 1996/08/20 04:48:27 deraadt Exp $ */ +/* $OpenBSD: main.c,v 1.12 1996/12/22 03:29:01 deraadt Exp $ */ /* * main.c - Point-to-Point Protocol main module @@ -20,7 +20,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: main.c,v 1.11 1996/08/20 04:48:27 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: main.c,v 1.12 1996/12/22 03:29:01 deraadt Exp $"; #endif #include <stdio.h> @@ -1010,7 +1010,10 @@ device_script(program, in, out) close(errfd); } } + /* revoke privs */ + seteuid(getuid()); setuid(getuid()); + setegid(getgid()); setgid(getgid()); execl("/bin/sh", "sh", "-c", program, (char *)0); syslog(LOG_ERR, "could not exec /bin/sh: %m"); |