summaryrefslogtreecommitdiffstats
path: root/sys/security/mac_biba/mac_biba.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2007-02-06 14:19:25 +0000
committerrwatson <rwatson@FreeBSD.org>2007-02-06 14:19:25 +0000
commit19777f08023deb4d6171525896812b717dd9c968 (patch)
tree5dc8beed75f16d01bef656c68bffd5b9829a48ff /sys/security/mac_biba/mac_biba.c
parentf82b2337b98055d193bfafd3608aa0505161ec29 (diff)
downloadFreeBSD-src-19777f08023deb4d6171525896812b717dd9c968.zip
FreeBSD-src-19777f08023deb4d6171525896812b717dd9c968.tar.gz
Introduce accessor functions mac_label_get() and mac_label_set() to replace
LABEL_TO_SLOT() macro used by policy modules to query and set label data in struct label. Instead of using a union, store an intptr_t, simplifying the API. Update policies: in most cases this required only small tweaks to current wrapper macros. In two cases, a single wrapper macros had to be split into separate get and set macros. Move struct label definition from _label.h to mac_internal.h and remove _label.h. With this change, policies may now treat struct label * as opaque, allowing us to change the layout of struct label without breaking the policy module ABI. For example, we could make the maximum number of policies with labels modifiable at boot-time rather than just at compile-time. Obtained from: TrustedBSD Project
Diffstat (limited to 'sys/security/mac_biba/mac_biba.c')
-rw-r--r--sys/security/mac_biba/mac_biba.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/security/mac_biba/mac_biba.c b/sys/security/mac_biba/mac_biba.c
index 21e2096..fc9fc3c 100644
--- a/sys/security/mac_biba/mac_biba.c
+++ b/sys/security/mac_biba/mac_biba.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 1999-2002 Robert N. M. Watson
+ * Copyright (c) 1999-2002, 2007 Robert N. M. Watson
* Copyright (c) 2001-2005 McAfee, Inc.
* All rights reserved.
*
@@ -132,8 +132,8 @@ SYSCTL_INT(_security_mac_biba, OID_AUTO, revocation_enabled, CTLFLAG_RW,
TUNABLE_INT("security.mac.biba.revocation_enabled", &revocation_enabled);
static int mac_biba_slot;
-#define SLOT(l) ((struct mac_biba *)LABEL_TO_SLOT((l), mac_biba_slot).l_ptr)
-#define SLOT_SET(l, val) (LABEL_TO_SLOT((l), mac_biba_slot).l_ptr = (val))
+#define SLOT(l) ((struct mac_biba *)mac_label_get((l), mac_biba_slot))
+#define SLOT_SET(l, val) mac_label_set((l), mac_biba_slot, (uintptr_t)(val))
static uma_zone_t zone_biba;
OpenPOWER on IntegriCloud