Fix a reversed suser(9) in SIOCG80211:IEEE80211_IOC_WEPKEY which prevents

root from reading the wireless card's WEP keys, but allows non-root.
This commit is contained in:
Brian Feldman 2003-11-05 04:16:48 +00:00
parent dfde783410
commit 5c8bb90bf7
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=122090

View file

@ -777,7 +777,7 @@ ieee80211_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
}
len = (u_int) ic->ic_nw_keys[kid].wk_len;
/* NB: only root can read WEP keys */
if (suser(curthread)) {
if (suser(curthread) == 0) {
bcopy(ic->ic_nw_keys[kid].wk_key, tmpkey, len);
} else {
bzero(tmpkey, len);