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 /sbin/pflogd | |
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 'sbin/pflogd')
-rw-r--r-- | sbin/pflogd/privsep.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sbin/pflogd/privsep.c b/sbin/pflogd/privsep.c index bcb242e0ff0..50807ada4e4 100644 --- a/sbin/pflogd/privsep.c +++ b/sbin/pflogd/privsep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: privsep.c,v 1.7 2004/02/13 19:01:57 otto Exp $ */ +/* $OpenBSD: privsep.c,v 1.8 2004/03/14 19:17:05 otto Exp $ */ /* * Copyright (c) 2003 Can Erkin Acar @@ -92,7 +92,8 @@ priv_init(void) /* Child - drop privileges and return */ if (chroot(pw->pw_dir) != 0) err(1, "unable to chroot"); - chdir("/"); + if (chdir("/") != 0) + err(1, "unable to chdir"); gidset[0] = pw->pw_gid; if (setgroups(1, gidset) == -1) |