From owner-p4-projects Thu Oct 24 13:57:37 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 8673E37B404; Thu, 24 Oct 2002 13:57:33 -0700 (PDT) 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 36D7B37B401 for ; Thu, 24 Oct 2002 13:57:33 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id A077243E4A for ; Thu, 24 Oct 2002 13:57:32 -0700 (PDT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id g9OKulmV029024 for ; Thu, 24 Oct 2002 13:56:47 -0700 (PDT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id g9OKuk4V029021 for perforce@freebsd.org; Thu, 24 Oct 2002 13:56:46 -0700 (PDT) Date: Thu, 24 Oct 2002 13:56:46 -0700 (PDT) Message-Id: <200210242056.g9OKuk4V029021@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 Subject: PERFORCE change 20081 for review To: Perforce Change Reviews Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG http://perforce.freebsd.org/chv.cgi?CH=20081 Change 20081 by rwatson@rwatson_tislabs on 2002/10/24 13:56:03 More consistently use mac_biba_privileged(subj) instead of the old equal_ok notion. Use the error response from mac_biba_privileged() for the sysctl check, rather than treating it as a boolean incorrectly. Affected files ... .. //depot/projects/trustedbsd/mac/sys/security/mac_biba/mac_biba.c#157 edit Differences ... ==== //depot/projects/trustedbsd/mac/sys/security/mac_biba/mac_biba.c#157 (text+ko) ==== @@ -299,7 +299,7 @@ } static int -mac_biba_subject_equal_ok(struct mac_biba *mac_biba) +mac_biba_privileged(struct mac_biba *mac_biba) { KASSERT((mac_biba->mb_flags & MAC_BIBA_FLAGS_BOTH) == @@ -325,14 +325,6 @@ } static int -mac_biba_privileged(struct mac_biba *mac_biba) -{ - - /* Equate the notion of "equal" with privilege. */ - return (mac_biba_subject_equal_ok(mac_biba)); -} - -static int mac_biba_high_single(struct mac_biba *mac_biba) { @@ -1475,7 +1467,7 @@ * their label. */ if (mac_biba_contains_equal(new)) { - error = mac_biba_subject_equal_ok(subj); + error = mac_biba_privileged(subj); if (error) return (error); } @@ -1672,7 +1664,7 @@ * subject must have appropriate privilege. */ if (mac_biba_contains_equal(new)) { - error = mac_biba_subject_equal_ok(subj); + error = mac_biba_privileged(subj); if (error) return (error); } @@ -1834,7 +1826,7 @@ * the subject must have appropriate privilege. */ if (mac_biba_contains_equal(new)) { - error = mac_biba_subject_equal_ok(subj); + error = mac_biba_privileged(subj); if (error) return (error); } @@ -1866,6 +1858,7 @@ void *old, size_t *oldlenp, int inkernel, void *new, size_t newlen) { struct mac_biba *subj; + int error; if (!mac_biba_enabled) return (0); @@ -1881,8 +1874,9 @@ if (new != NULL) { if (namelen > 0 && name[0] == 0) return (0); - if (!mac_biba_privileged(subj)) - return (EPERM); + error = mac_biba_privileged(subj); + if (error) + return (error); } return (0); @@ -2247,7 +2241,7 @@ * the subject must have appropriate privilege. */ if (mac_biba_contains_equal(new)) { - error = mac_biba_subject_equal_ok(subj); + error = mac_biba_privileged(subj); if (error) return (error); } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message