PERFORCE change 107162 for review

Robert Watson rwatson at FreeBSD.org
Tue Oct 3 04:29:09 PDT 2006


http://perforce.freebsd.org/chv.cgi?CH=107162

Change 107162 by rwatson at rwatson_peppercorn on 2006/10/03 11:28:24

	Replicate if_wi changes into 6.x if_owi for priv(9).

Affected files ...

.. //depot/projects/trustedbsd/priv6/src/sys/dev/owi/if_owi.c#2 edit

Differences ...

==== //depot/projects/trustedbsd/priv6/src/sys/dev/owi/if_owi.c#2 (text+ko) ====

@@ -64,6 +64,7 @@
 #include <sys/endian.h>
 #include <sys/sockio.h>
 #include <sys/mbuf.h>
+#include <sys/priv.h>
 #include <sys/proc.h>
 #include <sys/kernel.h>
 #include <sys/socket.h>
@@ -1397,7 +1398,8 @@
 			break;
 		}
 		/* Don't show WEP keys to non-root users. */
-		if (wreq.wi_type == WI_RID_DEFLT_CRYPT_KEYS && suser(td))
+		if (wreq.wi_type == WI_RID_DEFLT_CRYPT_KEYS &&
+		    priv_check(td, PRIV_NET80211_GETKEY))
 			break;
 		if (wreq.wi_type == WI_RID_IFACE_STATS) {
 			bcopy((char *)&sc->wi_stats, (char *)&wreq.wi_val,
@@ -1409,7 +1411,7 @@
 		}
 #ifdef WICACHE
 		else if (wreq.wi_type == WI_RID_ZERO_CACHE) {
-			error = suser(td);
+			error = priv_check(td, PRIV_DRIVER);
 			if (error)
 				break;
 			sc->wi_sigitems = sc->wi_nextitem = 0;
@@ -1447,7 +1449,7 @@
 		error = copyout(&wreq, ifr->ifr_data, sizeof(wreq));
 		break;
 	case SIOCSWAVELAN:
-		if ((error = suser(td)))
+		if ((error = priv_check(td, PRIV_DRIVER)))
 			goto out;
 		error = copyin(ifr->ifr_data, &wreq, sizeof(wreq));
 		if (error)
@@ -1522,7 +1524,7 @@
 				break;
 			}
 			len = sc->wi_keys.wi_keys[ireq->i_val].wi_keylen;
-			if (suser(td))
+			if (priv_check(td, PRIV_NET80211_GETKEY))
 				bcopy(sc->wi_keys.wi_keys[ireq->i_val].wi_keydat,
 				    tmpkey, len);
 			else
@@ -1575,7 +1577,7 @@
 		}
 		break;
 	case SIOCS80211:
-		if ((error = suser(td)))
+		if ((error = priv_check(td, PRIV_NET80211_MANAGE)))
 			goto out;
 		switch(ireq->i_type) {
 		case IEEE80211_IOC_SSID:


More information about the trustedbsd-cvs mailing list