Close PR #20963. Do not pass encryption keys back to the caller via

wi_ioctl() unless they're the superuser.
This commit is contained in:
wpaul 2000-09-07 17:05:12 +00:00
parent 075c4a4a7c
commit 41a8897cd6
2 changed files with 6 additions and 0 deletions

View File

@ -1008,6 +1008,9 @@ static int wi_ioctl(ifp, command, data)
error = copyin(ifr->ifr_data, &wreq, sizeof(wreq));
if (error)
break;
/* Don't show WEP keys to non-root users. */
if (wreq.wi_type == WI_RID_DEFLT_CRYPT_KEYS && suser(p))
break;
if (wreq.wi_type == WI_RID_IFACE_STATS) {
bcopy((char *)&sc->wi_stats, (char *)&wreq.wi_val,
sizeof(sc->wi_stats));

View File

@ -1008,6 +1008,9 @@ static int wi_ioctl(ifp, command, data)
error = copyin(ifr->ifr_data, &wreq, sizeof(wreq));
if (error)
break;
/* Don't show WEP keys to non-root users. */
if (wreq.wi_type == WI_RID_DEFLT_CRYPT_KEYS && suser(p))
break;
if (wreq.wi_type == WI_RID_IFACE_STATS) {
bcopy((char *)&sc->wi_stats, (char *)&wreq.wi_val,
sizeof(sc->wi_stats));