summaryrefslogtreecommitdiffstats
path: root/sys/dev/wi/if_wi.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2002-04-01 21:31:13 +0000
committerjhb <jhb@FreeBSD.org>2002-04-01 21:31:13 +0000
commitdc2e474f79c1287592679cd5e0c4c2307feccd60 (patch)
tree79021f0d43a5858be317d5cd33eac8cd4962b336 /sys/dev/wi/if_wi.c
parent34c7d606c9818987384d404948ecdc98521462bd (diff)
downloadFreeBSD-src-dc2e474f79c1287592679cd5e0c4c2307feccd60.zip
FreeBSD-src-dc2e474f79c1287592679cd5e0c4c2307feccd60.tar.gz
Change the suser() API to take advantage of td_ucred as well as do a
general cleanup of the API. The entire API now consists of two functions similar to the pre-KSE API. The suser() function takes a thread pointer as its only argument. The td_ucred member of this thread must be valid so the only valid thread pointers are curthread and a few kernel threads such as thread0. The suser_cred() function takes a pointer to a struct ucred as its first argument and an integer flag as its second argument. The flag is currently only used for the PRISON_ROOT flag. Discussed on: smp@
Diffstat (limited to 'sys/dev/wi/if_wi.c')
-rw-r--r--sys/dev/wi/if_wi.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/dev/wi/if_wi.c b/sys/dev/wi/if_wi.c
index 3b88f95..71a66ee 100644
--- a/sys/dev/wi/if_wi.c
+++ b/sys/dev/wi/if_wi.c
@@ -1672,7 +1672,7 @@ wi_ioctl(ifp, command, data)
struct wi_req wreq;
struct ifreq *ifr;
struct ieee80211req *ireq;
- struct proc *p = curproc;
+ struct thread *td = curthread;
sc = ifp->if_softc;
WI_LOCK(sc);
@@ -1724,7 +1724,7 @@ wi_ioctl(ifp, command, data)
if (error)
break;
/* Don't show WEP keys to non-root users. */
- if (wreq.wi_type == WI_RID_DEFLT_CRYPT_KEYS && suser(p))
+ if (wreq.wi_type == WI_RID_DEFLT_CRYPT_KEYS && suser(td))
break;
if (wreq.wi_type == WI_RID_IFACE_STATS) {
bcopy((char *)&sc->wi_stats, (char *)&wreq.wi_val,
@@ -1768,7 +1768,7 @@ wi_ioctl(ifp, command, data)
error = copyout(&wreq, ifr->ifr_data, sizeof(wreq));
break;
case SIOCSWAVELAN:
- if ((error = suser(p)))
+ if ((error = suser(td)))
goto out;
error = copyin(ifr->ifr_data, &wreq, sizeof(wreq));
if (error)
@@ -1809,7 +1809,7 @@ wi_ioctl(ifp, command, data)
error = copyout(&wreq, ifr->ifr_data, sizeof(wreq));
break;
case SIOCSPRISM2DEBUG:
- if ((error = suser(p)))
+ if ((error = suser(td)))
goto out;
error = copyin(ifr->ifr_data, &wreq, sizeof(wreq));
if (error)
@@ -1858,7 +1858,7 @@ wi_ioctl(ifp, command, data)
break;
}
len = sc->wi_keys.wi_keys[ireq->i_val].wi_keylen;
- if (suser(p))
+ if (suser(td))
bcopy(sc->wi_keys.wi_keys[ireq->i_val].wi_keydat,
tmpkey, len);
else
@@ -1911,7 +1911,7 @@ wi_ioctl(ifp, command, data)
}
break;
case SIOCS80211:
- if ((error = suser(p)))
+ if ((error = suser(td)))
goto out;
switch(ireq->i_type) {
case IEEE80211_IOC_SSID:
OpenPOWER on IntegriCloud