summaryrefslogtreecommitdiff
path: root/usr.sbin/hostapd
diff options
context:
space:
mode:
authorMoritz Jodeit <moritz@cvs.openbsd.org>2005-04-13 20:09:50 +0000
committerMoritz Jodeit <moritz@cvs.openbsd.org>2005-04-13 20:09:50 +0000
commitf3c32bd80b86ce9b84bb63ae31702e3d81210ce0 (patch)
tree7a056d05b13ececbea037459cc340392e59ed5e2 /usr.sbin/hostapd
parentc462c576fa74bf372b1fa6fbab07df2f380e964c (diff)
really abort, when privdrop fails. ok reyk@
Diffstat (limited to 'usr.sbin/hostapd')
-rw-r--r--usr.sbin/hostapd/privsep.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/hostapd/privsep.c b/usr.sbin/hostapd/privsep.c
index 55b13d7982f..1c11b98b7b4 100644
--- a/usr.sbin/hostapd/privsep.c
+++ b/usr.sbin/hostapd/privsep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: privsep.c,v 1.4 2005/04/13 19:52:02 reyk Exp $ */
+/* $OpenBSD: privsep.c,v 1.5 2005/04/13 20:09:49 moritz Exp $ */
/*
* Copyright (c) 2004, 2005 Reyk Floeter <reyk@vantronix.net>
@@ -122,9 +122,9 @@ hostapd_priv_init(struct hostapd_config *cfg)
/*
* Drop privileges and clear the group access list
*/
- if ((setgroups(1, &pw->pw_gid) ||
- setresuid(pw->pw_uid, pw->pw_uid, pw->pw_uid) ||
- setresgid(pw->pw_gid, pw->pw_gid, pw->pw_gid)) == -1)
+ if (setgroups(1, &pw->pw_gid) == -1 ||
+ setresuid(pw->pw_uid, pw->pw_uid, pw->pw_uid) == -1 ||
+ setresgid(pw->pw_gid, pw->pw_gid, pw->pw_gid) == -1)
hostapd_fatal("can't drop privileges");
close(socks[0]);