freebsd-dev/sys/security
Robert Watson 05e830f1e7 Rewrite Biba and MLS label externalization code to use sbufs instead
of C strings internally; C strings require a lot of return value
checking that (a) takes a lot of space, and (b) is difficult to get
right.  Prior to the advent of compartment support, modeling APIs
for helper functions on snprintf worked fine; with the additional
complexity, the sbuf_printf() API makes a lot more sense.

While doing this, break out the printing of sequential compartment
lists into a helper function, mac_{biba,mls}_compartment_to_string().
This permits the main body of mac_{biba,mls}_element_to_string()
to be concerned only with identifying sequential ranges rather
than rendering.

At a less disruptive moment, we'll push the move from snprintf()-like
interface to sbuf()-like interface up into the MAC Framework layer.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2003-05-31 19:01:44 +00:00
..
mac Rename MAC_MAX_POLICIES to MAC_MAX_SLOTS, since the variables and 2003-05-08 19:49:42 +00:00
mac_biba Rewrite Biba and MLS label externalization code to use sbufs instead 2003-05-31 19:01:44 +00:00
mac_bsdextended Trim "trustedbsd_" from the front of the policy module "short names"; 2003-03-27 19:26:39 +00:00
mac_ifoff Rather than check for M_PKTHDR and conditionally perform access control, 2003-04-18 20:22:23 +00:00
mac_lomac Enable the MAC_ALWAYS_LABEL_MBUF flag for the Biba, LOMAC, MLS, and Test 2003-04-15 20:51:18 +00:00
mac_mls Rewrite Biba and MLS label externalization code to use sbufs instead 2003-05-31 19:01:44 +00:00
mac_none Trim "trustedbsd_" from the front of the policy module "short names"; 2003-03-27 19:26:39 +00:00
mac_partition Trim "trustedbsd_" from the front of the policy module "short names"; 2003-03-27 19:26:39 +00:00
mac_portacl Including <sys/stdint.h> is (almost?) universally only to be able to use 2003-03-18 08:45:25 +00:00
mac_seeotheruids Trim "trustedbsd_" from the front of the policy module "short names"; 2003-03-27 19:26:39 +00:00
mac_stub Trim "trustedbsd_" from the front of the policy module "short names"; 2003-03-27 19:26:39 +00:00
mac_test Modify mac_test policy to invoke WITNESS_WARN() when a potentially 2003-04-15 21:20:34 +00:00