summaryrefslogtreecommitdiff
path: root/usr.sbin/tcpdump
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/tcpdump')
-rw-r--r--usr.sbin/tcpdump/privsep.c4
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();