diff options
author | jhb <jhb@FreeBSD.org> | 2002-04-01 21:31:13 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2002-04-01 21:31:13 +0000 |
commit | dc2e474f79c1287592679cd5e0c4c2307feccd60 (patch) | |
tree | 79021f0d43a5858be317d5cd33eac8cd4962b336 /sys/dev/wl | |
parent | 34c7d606c9818987384d404948ecdc98521462bd (diff) | |
download | FreeBSD-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/wl')
-rw-r--r-- | sys/dev/wl/if_wl.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/dev/wl/if_wl.c b/sys/dev/wl/if_wl.c index dc9ca96..2563bcd 100644 --- a/sys/dev/wl/if_wl.c +++ b/sys/dev/wl/if_wl.c @@ -1214,7 +1214,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t data) /* pointer to buffer in user space */ up = (void *)ifr->ifr_data; /* work out if they're root */ - isroot = (suser_td(td) == 0); + isroot = (suser(td) == 0); for (i = 0; i < 0x40; i++) { /* don't hand the DES key out to non-root users */ @@ -1229,7 +1229,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t data) /* copy the PSA in from the caller; we only copy _some_ values */ case SIOCSWLPSA: /* root only */ - if ((error = suser_td(td))) + if ((error = suser(td))) break; error = EINVAL; /* assume the worst */ /* pointer to buffer in user space containing data */ @@ -1283,7 +1283,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t data) */ case SIOCSWLCNWID: /* root only */ - if ((error = suser_td(td))) + if ((error = suser(td))) break; if (!(ifp->if_flags & IFF_UP)) { error = EIO; /* only allowed while up */ @@ -1301,7 +1301,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t data) /* copy the EEPROM in 2.4 Gz WaveMODEM out to the caller */ case SIOCGWLEEPROM: /* root only */ - if ((error = suser_td(td))) + if ((error = suser(td))) break; /* pointer to buffer in user space */ up = (void *)ifr->ifr_data; @@ -1324,7 +1324,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t data) /* zero (Delete) the wl cache */ case SIOCDWLCACHE: /* root only */ - if ((error = suser_td(td))) + if ((error = suser(td))) break; wl_cache_zero(unit); break; |