diff options
author | brian <brian@FreeBSD.org> | 1997-11-09 06:22:49 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 1997-11-09 06:22:49 +0000 |
commit | eae0088b91cbc4408b450aa68745064732b86734 (patch) | |
tree | 330d8937c8f71a0d93df3a925214b73ae069d846 /usr.sbin/ppp/chat.c | |
parent | adcd7ae702997873c044a63779bc24521e2f9349 (diff) | |
download | FreeBSD-src-eae0088b91cbc4408b450aa68745064732b86734.zip FreeBSD-src-eae0088b91cbc4408b450aa68745064732b86734.tar.gz |
Introduce ID0 logging.
Stay as the invoking uid as much as possible.
Execution as a normal user is still forbidden for now,
so these changes are pretty ineffective.
The next commit will implement the modifications suggested
on -hackers a number of days ago.
Diffstat (limited to 'usr.sbin/ppp/chat.c')
-rw-r--r-- | usr.sbin/ppp/chat.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/usr.sbin/ppp/chat.c b/usr.sbin/ppp/chat.c index 58d61b3..bf537f5 100644 --- a/usr.sbin/ppp/chat.c +++ b/usr.sbin/ppp/chat.c @@ -18,7 +18,7 @@ * Columbus, OH 43221 * (614)451-1883 * - * $Id: chat.c,v 1.35 1997/10/26 01:02:22 brian Exp $ + * $Id: chat.c,v 1.36 1997/10/29 01:19:39 brian Exp $ * * TODO: * o Support more UUCP compatible control sequences. @@ -460,16 +460,8 @@ ExecStr(char *command, char *out) LogPrintf(LogCHAT, "dup2(nb, 0) in ExecStr: %s\n", strerror(errno)); return; } + setuid(geteuid()); LogPrintf(LogCHAT, "exec: %s\n", command); - /* switch back to original privileges */ - if (setgid(getgid()) < 0) { - LogPrintf(LogCHAT, "setgid: %s\n", strerror(errno)); - exit(1); - } - if (setuid(getuid()) < 0) { - LogPrintf(LogCHAT, "setuid: %s\n", strerror(errno)); - exit(1); - } pid = execvp(command, vector); LogPrintf(LogCHAT, "execvp failed for (%d/%d): %s\n", pid, errno, command); exit(127); |