Index: sys/_label.h =================================================================== RCS file: /data/ncvs/src/sys/sys/_label.h,v retrieving revision 1.3 diff -u -r1.3 _label.h --- sys/_label.h 4 Nov 2002 02:35:46 -0000 1.3 +++ sys/_label.h 8 May 2003 15:09:00 -0000 @@ -41,7 +41,7 @@ * and various other messes. */ -#define MAC_MAX_POLICIES 4 +#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 */ Index: kern/kern_mac.c =================================================================== RCS file: /data/ncvs/src/sys/kern/kern_mac.c,v retrieving revision 1.89 diff -u -r1.89 kern_mac.c --- kern/kern_mac.c 7 May 2003 17:49:24 -0000 1.89 +++ kern/kern_mac.c 8 May 2003 15:09:16 -0000 @@ -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_slot_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;