diff options
author | Otto Moerbeek <otto@cvs.openbsd.org> | 2005-05-23 06:56:43 +0000 |
---|---|---|
committer | Otto Moerbeek <otto@cvs.openbsd.org> | 2005-05-23 06:56:43 +0000 |
commit | 51f7e1263318c3fc9c7dc79d89556d7cde372dd1 (patch) | |
tree | 1f13757f0bb13c1ae7c74dfc5873d35c51e71103 /usr.sbin/tcpdump | |
parent | 5b44b31e793184e824651a218ffc9c819d9d8f56 (diff) |
Call endpwent() _after_ we're done with the struct passwd fields.
ok canacar@
Diffstat (limited to 'usr.sbin/tcpdump')
-rw-r--r-- | usr.sbin/tcpdump/privsep.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/tcpdump/privsep.c b/usr.sbin/tcpdump/privsep.c index e7c877ba9c5..ba885e10a1e 100644 --- a/usr.sbin/tcpdump/privsep.c +++ b/usr.sbin/tcpdump/privsep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: privsep.c,v 1.20 2005/05/22 19:53:33 moritz Exp $ */ +/* $OpenBSD: privsep.c,v 1.21 2005/05/23 06:56:42 otto Exp $ */ /* * Copyright (c) 2003 Can Erkin Acar @@ -155,7 +155,6 @@ priv_init(int argc, char **argv) pw = getpwnam("_tcpdump"); if (pw == NULL) errx(1, "unknown user _tcpdump"); - endpwent(); /* chroot, drop privs and return */ if (chroot(pw->pw_dir) != 0) @@ -170,6 +169,7 @@ priv_init(int argc, char **argv) err(1, "setresgid() failed"); if (setresuid(pw->pw_uid, pw->pw_uid, pw->pw_uid) == -1) err(1, "setresuid() failed"); + endpwent(); } else { /* Parent - drop suid privileges */ gid = getgid(); |