summaryrefslogtreecommitdiff
path: root/usr.sbin/tcpdump/privsep.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/tcpdump/privsep.c')
-rw-r--r--usr.sbin/tcpdump/privsep.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/tcpdump/privsep.c b/usr.sbin/tcpdump/privsep.c
index fc0c6cdfc59..feed7d69d5f 100644
--- a/usr.sbin/tcpdump/privsep.c
+++ b/usr.sbin/tcpdump/privsep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: privsep.c,v 1.4 2004/02/05 22:12:06 otto Exp $ */
+/* $OpenBSD: privsep.c,v 1.5 2004/03/14 19:17:05 otto Exp $ */
/*
* Copyright (c) 2003 Can Erkin Acar
@@ -128,7 +128,8 @@ priv_init(int argc, char **argv)
/* chroot, drop privs and return */
if (chroot(pw->pw_dir) != 0)
err(1, "unable to chroot");
- chdir("/");
+ if (chdir("/") != 0)
+ err(1, "unable to chdir");
/* drop to _tcpdump */
if (setgroups(1, &pw->pw_gid) == -1)