diff options
author | Hans-Joerg Hoexer <hshoexer@cvs.openbsd.org> | 2004-03-15 16:34:29 +0000 |
---|---|---|
committer | Hans-Joerg Hoexer <hshoexer@cvs.openbsd.org> | 2004-03-15 16:34:29 +0000 |
commit | bc61a1cb5747e007ae7ede59fdee92d7bc659743 (patch) | |
tree | ff301f561d26719941b40522a099effceaa1df1d /sbin/isakmpd | |
parent | bae07d0a7958ee604b131ef377f6c143d05ab88b (diff) |
Properly check succes of chroot().
ok ho@
Diffstat (limited to 'sbin/isakmpd')
-rw-r--r-- | sbin/isakmpd/monitor.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sbin/isakmpd/monitor.c b/sbin/isakmpd/monitor.c index 7792b0753fc..49983820dc4 100644 --- a/sbin/isakmpd/monitor.c +++ b/sbin/isakmpd/monitor.c @@ -1,4 +1,4 @@ -/* $OpenBSD: monitor.c,v 1.11 2004/03/15 16:29:00 hshoexer Exp $ */ +/* $OpenBSD: monitor.c,v 1.12 2004/03/15 16:34:28 hshoexer Exp $ */ /* * Copyright (c) 2003 Håkan Olsson. All rights reserved. @@ -103,9 +103,8 @@ monitor_init (void) /* The child process should drop privileges now. */ if (!m_state.pid) { - if (chroot (pw->pw_dir) != 0) - log_fatal ("monitor_init: chroot(\"%s\") failed", pw->pw_dir); - chdir ("/"); + if (chroot (pw->pw_dir) != 0 || chdir("/") != 0) + log_fatal ("monitor_init: chroot failed"); if (setgid (pw->pw_gid) != 0) log_fatal ("monitor_init: setgid(%d) failed", pw->pw_gid); |