diff options
author | Otto Moerbeek <otto@cvs.openbsd.org> | 2004-03-14 19:17:06 +0000 |
---|---|---|
committer | Otto Moerbeek <otto@cvs.openbsd.org> | 2004-03-14 19:17:06 +0000 |
commit | 89d99c0284f993829fecf7c794a4e503c08ee5c5 (patch) | |
tree | dcb5c7a99e1f49c1bd52284f9d3b003a5652a300 /usr.sbin/tcpdump | |
parent | dc6eb02a705bb48a5ff401ae332781dec60bba96 (diff) |
Check return code of chdir() after chroot(); noted by Joris Vink, slight mod
from avsm@.
ok avsm@ hshoexer@ henning@
Diffstat (limited to 'usr.sbin/tcpdump')
-rw-r--r-- | usr.sbin/tcpdump/privsep.c | 5 |
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) |