From owner-p4-projects@FreeBSD.ORG Tue Oct 3 11:29:07 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id AD14716A47C; Tue, 3 Oct 2006 11:29:07 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8291C16A403 for ; Tue, 3 Oct 2006 11:29:07 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3F62F43D4C for ; Tue, 3 Oct 2006 11:29:07 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k93BT7RJ073050 for ; Tue, 3 Oct 2006 11:29:07 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k93BT6JW073047 for perforce@freebsd.org; Tue, 3 Oct 2006 11:29:06 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Tue, 3 Oct 2006 11:29:06 GMT Message-Id: <200610031129.k93BT6JW073047@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 107162 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Oct 2006 11:29:08 -0000 http://perforce.freebsd.org/chv.cgi?CH=107162 Change 107162 by rwatson@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 #include #include +#include #include #include #include @@ -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: