diff options
| author | Ollivier Robert <roberto@FreeBSD.org> | 2000-06-19 00:17:13 +0000 |
|---|---|---|
| committer | Ollivier Robert <roberto@FreeBSD.org> | 2000-06-19 00:17:13 +0000 |
| commit | a0b74543ffb1fe04e7d5dde66bd82cf3d0c7beff (patch) | |
| tree | 0fdee87f3a1ec3a8f1c3fd06ce178ff89b127d8a /sys | |
| parent | 4dc93581d1e4744c115bcde47179036e0541657f (diff) | |
Notes
Diffstat (limited to 'sys')
| -rw-r--r-- | sys/dev/wi/if_wi.c | 13 | ||||
| -rw-r--r-- | sys/i386/isa/if_wi.c | 13 |
2 files changed, 20 insertions, 6 deletions
diff --git a/sys/dev/wi/if_wi.c b/sys/dev/wi/if_wi.c index 441beafa3c5e..deb797cea676 100644 --- a/sys/dev/wi/if_wi.c +++ b/sys/dev/wi/if_wi.c @@ -73,6 +73,8 @@ #include <sys/sockio.h> #include <sys/mbuf.h> #include <sys/kernel.h> +#include <sys/proc.h> +#include <sys/ucred.h> #include <sys/socket.h> #include <sys/module.h> #include <sys/bus.h> @@ -962,14 +964,17 @@ static int wi_ioctl(ifp, command, data) struct wi_softc *sc; struct wi_req wreq; struct ifreq *ifr; + struct proc *p = curproc; s = splimp(); sc = ifp->if_softc; ifr = (struct ifreq *)data; - if (sc->wi_gone) - return(ENODEV); + if (sc->wi_gone) { + error = ENODEV; + goto out; + } switch(command) { case SIOCSIFADDR: @@ -1038,6 +1043,8 @@ static int wi_ioctl(ifp, command, data) error = copyout(&wreq, ifr->ifr_data, sizeof(wreq)); break; case SIOCSWAVELAN: + if ((error = suser(p))) + goto out; error = copyin(ifr->ifr_data, &wreq, sizeof(wreq)); if (error) break; @@ -1057,7 +1064,7 @@ static int wi_ioctl(ifp, command, data) error = EINVAL; break; } - +out: splx(s); return(error); diff --git a/sys/i386/isa/if_wi.c b/sys/i386/isa/if_wi.c index 441beafa3c5e..deb797cea676 100644 --- a/sys/i386/isa/if_wi.c +++ b/sys/i386/isa/if_wi.c @@ -73,6 +73,8 @@ #include <sys/sockio.h> #include <sys/mbuf.h> #include <sys/kernel.h> +#include <sys/proc.h> +#include <sys/ucred.h> #include <sys/socket.h> #include <sys/module.h> #include <sys/bus.h> @@ -962,14 +964,17 @@ static int wi_ioctl(ifp, command, data) struct wi_softc *sc; struct wi_req wreq; struct ifreq *ifr; + struct proc *p = curproc; s = splimp(); sc = ifp->if_softc; ifr = (struct ifreq *)data; - if (sc->wi_gone) - return(ENODEV); + if (sc->wi_gone) { + error = ENODEV; + goto out; + } switch(command) { case SIOCSIFADDR: @@ -1038,6 +1043,8 @@ static int wi_ioctl(ifp, command, data) error = copyout(&wreq, ifr->ifr_data, sizeof(wreq)); break; case SIOCSWAVELAN: + if ((error = suser(p))) + goto out; error = copyin(ifr->ifr_data, &wreq, sizeof(wreq)); if (error) break; @@ -1057,7 +1064,7 @@ static int wi_ioctl(ifp, command, data) error = EINVAL; break; } - +out: splx(s); return(error); |
