summaryrefslogtreecommitdiff
path: root/usr.sbin/hostapd/privsep.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/hostapd/privsep.c')
-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]);