summaryrefslogtreecommitdiff
path: root/sys/dev/ic
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2002-03-31 00:33:43 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2002-03-31 00:33:43 +0000
commit4b06220c51fafcd62e10f0ae81ff09ef760f5378 (patch)
treea5edabc6d6961e9869640090e253f57312201865 /sys/dev/ic
parent3f623560bd1877aefb22c4ba2e3d3f316803cf37 (diff)
check for super user more; millert@ ok
Diffstat (limited to 'sys/dev/ic')
-rw-r--r--sys/dev/ic/if_wi.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/sys/dev/ic/if_wi.c b/sys/dev/ic/if_wi.c
index f1d07776b82..dd8f0a21b41 100644
--- a/sys/dev/ic/if_wi.c
+++ b/sys/dev/ic/if_wi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_wi.c,v 1.32 2002/03/30 22:43:58 mickey Exp $ */
+/* $OpenBSD: if_wi.c,v 1.33 2002/03/31 00:33:42 mickey Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -124,7 +124,7 @@ u_int32_t widebug = WIDEBUG;
#if !defined(lint) && !defined(__OpenBSD__)
static const char rcsid[] =
- "$OpenBSD: if_wi.c,v 1.32 2002/03/30 22:43:58 mickey Exp $";
+ "$OpenBSD: if_wi.c,v 1.33 2002/03/31 00:33:42 mickey Exp $";
#endif /* lint */
#ifdef foo
@@ -1201,6 +1201,18 @@ wi_ioctl(ifp, command, data)
}
switch(command) {
+ case SIOCSWAVELAN:
+ case SIOCS80211NWID:
+ case SIOCS80211NWKEY:
+ case SIOCS80211POWER:
+ error = suser(p->p_ucred, &p->p_acflag);
+ if (error)
+ return (error);
+ default:
+ break;
+ }
+
+ switch(command) {
case SIOCSIFADDR:
ifp->if_flags |= IFF_UP;
switch (ifa->ifa_addr->sa_family) {
@@ -1289,9 +1301,6 @@ wi_ioctl(ifp, command, data)
error = copyout(&wreq, ifr->ifr_data, sizeof(wreq));
break;
case SIOCSWAVELAN:
- error = suser(p->p_ucred, &p->p_acflag);
- if (error)
- break;
error = copyin(ifr->ifr_data, &wreq, sizeof(wreq));
if (error)
break;
@@ -1329,9 +1338,6 @@ wi_ioctl(ifp, command, data)
}
break;
case SIOCS80211NWID:
- error = suser(p->p_ucred, &p->p_acflag);
- if (error)
- break;
error = copyin(ifr->ifr_data, &nwid, sizeof(nwid));
if (error != 0)
break;