summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormsf <msf@openbsd.org>2005-05-21 19:18:51 +0000
committermsf <msf@openbsd.org>2005-05-21 19:18:51 +0000
commit09c3f497de10acfd0a180e542649469a5fc460dc (patch)
tree2273ef8f12fed7cc918ad75f3bb6abf25ce36039
parentadd i386 optimized in4_cksum (diff)
downloadwireguard-openbsd-09c3f497de10acfd0a180e542649469a5fc460dc.tar.xz
wireguard-openbsd-09c3f497de10acfd0a180e542649469a5fc460dc.zip
hostapd doesn't really do much without root privileges, so check for that early
ok reyk@
-rw-r--r--usr.sbin/hostapd/hostapd.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.sbin/hostapd/hostapd.c b/usr.sbin/hostapd/hostapd.c
index 4040dd070bd..ca4f4661b37 100644
--- a/usr.sbin/hostapd/hostapd.c
+++ b/usr.sbin/hostapd/hostapd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hostapd.c,v 1.9 2005/04/14 10:59:56 reyk Exp $ */
+/* $OpenBSD: hostapd.c,v 1.10 2005/05/21 19:18:51 msf Exp $ */
/*
* Copyright (c) 2004, 2005 Reyk Floeter <reyk@vantronix.net>
@@ -367,6 +367,9 @@ main(int argc, char *argv[])
daemon(0, 0);
}
+ if (geteuid())
+ hostapd_fatal("need root privileges\n");
+
/* Parse the configuration file */
hostapd_parse_file(cfg);