summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUwe Stuehler <uwe@cvs.openbsd.org>2005-04-03 01:35:07 +0000
committerUwe Stuehler <uwe@cvs.openbsd.org>2005-04-03 01:35:07 +0000
commitbadc0ff2f722af5ded41bf6344b8e76a32e9017d (patch)
tree1fc5dd955a7856246f0ad7a2240e2bcf2c1da4fa
parent526a93efeb85953076b923d9e79f7f241eea5e10 (diff)
protect SIOCSRAYPARAM and SIOCS80211NWID
-rw-r--r--sys/dev/pcmcia/if_ray.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/dev/pcmcia/if_ray.c b/sys/dev/pcmcia/if_ray.c
index ecadf8e440b..a0aa3041419 100644
--- a/sys/dev/pcmcia/if_ray.c
+++ b/sys/dev/pcmcia/if_ray.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ray.c,v 1.26 2005/01/27 17:04:55 millert Exp $ */
+/* $OpenBSD: if_ray.c,v 1.27 2005/04/03 01:35:06 uwe Exp $ */
/* $NetBSD: if_ray.c,v 1.21 2000/07/05 02:35:54 onoe Exp $ */
/*
@@ -1032,6 +1032,8 @@ ray_ioctl(ifp, cmd, data)
error = ifmedia_ioctl(ifp, ifr, &sc->sc_media, cmd);
break;
case SIOCSRAYPARAM:
+ if ((error = suser(curproc, 0)) != 0)
+ break;
RAY_DPRINTF(("%s: ioctl: cmd SIOCSRAYPARAM\n", ifp->if_xname));
if ((error = copyin(ifr->ifr_data, &pr, sizeof(pr))))
break;
@@ -1058,6 +1060,8 @@ ray_ioctl(ifp, cmd, data)
error = error2 ? error2 : error;
break;
case SIOCS80211NWID:
+ if ((error = suser(curproc, 0)) != 0)
+ break;
RAY_DPRINTF(("%s: ioctl: cmd SIOCS80211NWID\n", ifp->if_xname));
/*
* if later people overwrite thats ok -- the latest version