From owner-p4-projects@FreeBSD.ORG Wed May 7 10:50:54 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4884C37B401; Wed, 7 May 2003 10:50:54 -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 1DA4637B431 for ; Wed, 7 May 2003 10:50:50 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 501F643F93 for ; Wed, 7 May 2003 10:50:50 -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 h47Hoo0U049471 for ; Wed, 7 May 2003 10:50:50 -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 h47Hon7E049468 for perforce@freebsd.org; Wed, 7 May 2003 10:50:49 -0700 (PDT) Date: Wed, 7 May 2003 10:50:49 -0700 (PDT) Message-Id: <200305071750.h47Hon7E049468@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 Subject: PERFORCE change 30706 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2003 17:50:55 -0000 http://perforce.freebsd.org/chv.cgi?CH=30706 Change 30706 by rwatson@rwatson_tislabs on 2003/05/07 10:49:58 Prefer the name "slots" to "policies" when refering to in-kernel transient object label limits. Affected files ... .. //depot/projects/trustedbsd/mac/sys/kern/kern_mac.c#384 edit .. //depot/projects/trustedbsd/mac/sys/sys/_label.h#7 edit Differences ... ==== //depot/projects/trustedbsd/mac/sys/kern/kern_mac.c#384 (text+ko) ==== @@ -98,14 +98,14 @@ SYSCTL_NODE(_security, OID_AUTO, mac, CTLFLAG_RW, 0, "TrustedBSD MAC policy controls"); -#if MAC_MAX_POLICIES > 32 -#error "MAC_MAX_POLICIES too large" +#if MAC_MAX_SLOTS > 32 +#error "MAC_MAX_SLOTS too large" #endif -static unsigned int mac_max_policies = MAC_MAX_POLICIES; -static unsigned int mac_policy_offsets_free = (1 << MAC_MAX_POLICIES) - 1; -SYSCTL_UINT(_security_mac, OID_AUTO, max_policies, CTLFLAG_RD, - &mac_max_policies, 0, ""); +static unsigned int mac_max_slots = MAC_MAX_SLOTS; +static unsigned int mac_slots_offsets_free = (1 << MAC_MAX_SLOTS) - 1; +SYSCTL_UINT(_security_mac, OID_AUTO, max_slots, CTLFLAG_RD, + &mac_max_slots, 0, ""); /* * Has the kernel started generating labeled objects yet? All read/write @@ -645,13 +645,13 @@ } } if (mpc->mpc_field_off != NULL) { - slot = ffs(mac_policy_offsets_free); + slot = ffs(mac_slot_offsets_free); if (slot == 0) { error = ENOMEM; goto out; } slot--; - mac_policy_offsets_free &= ~(1 << slot); + mac_slot_offsets_free &= ~(1 << slot); *mpc->mpc_field_off = slot; } mpc->mpc_runtime_flags |= MPC_RUNTIME_FLAG_REGISTERED; ==== //depot/projects/trustedbsd/mac/sys/sys/_label.h#7 (text+ko) ==== @@ -41,7 +41,7 @@ * and various other messes. */ -#define MAC_MAX_POLICIES 8 +#define MAC_MAX_SLOTS 8 #define MAC_FLAG_INITIALIZED 0x0000001 /* Is initialized for use. */ @@ -50,7 +50,7 @@ union { void *l_ptr; long l_long; - } l_perpolicy[MAC_MAX_POLICIES]; + } l_perpolicy[MAC_MAX_SLOTS]; }; #endif /* !_SYS__LABEL_H */