HardenedBSD/sys/security
Robert Watson 5c8dd34218 Move to C99 sparse structure initialization for the mac_policy_ops
structure definition, rather than using an operation vector
we translate into the structure.  Originally, we used a vector
for two reasons:

(1) We wanted to define the structure sparsely, which wasn't
    supported by the C compiler for structures.  For a policy
    with five entry points, you don't want to have to stick in
    a few hundred NULL function pointers.

(2) We thought it would improve ABI compatibility allowing modules
    to work with kernels that had a superset of the entry points
    defined in the module, even if the kernel had changed its
    entry point set.

Both of these no longer apply:

(1) C99 gives us a way to sparsely define a static structure.

(2) The ABI problems existed anyway, due to enumeration numbers,
    argument changes, and semantic mismatches.  Since the going
    rule for FreeBSD is that you really need your modules to
    pretty closely match your kernel, it's not worth the
    complexity.

This submit eliminates the operation vector, dynamic allocation
of the operation structure, copying of the vector to the
structure, and redoes the vectors in each policy to direct
structure definitions.  One enourmous benefit of this change
is that we now get decent type checking on policy entry point
implementation arguments.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2002-10-30 18:48:51 +00:00
..
lomac Regularize the vop_stdlock'ing protocol across all the filesystems 2002-10-14 03:20:36 +00:00
mac Move to C99 sparse structure initialization for the mac_policy_ops 2002-10-30 18:48:51 +00:00
mac_biba Move to C99 sparse structure initialization for the mac_policy_ops 2002-10-30 18:48:51 +00:00
mac_bsdextended Move to C99 sparse structure initialization for the mac_policy_ops 2002-10-30 18:48:51 +00:00
mac_ifoff Move to C99 sparse structure initialization for the mac_policy_ops 2002-10-30 18:48:51 +00:00
mac_mls Move to C99 sparse structure initialization for the mac_policy_ops 2002-10-30 18:48:51 +00:00
mac_none Move to C99 sparse structure initialization for the mac_policy_ops 2002-10-30 18:48:51 +00:00
mac_partition Move to C99 sparse structure initialization for the mac_policy_ops 2002-10-30 18:48:51 +00:00
mac_seeotheruids Move to C99 sparse structure initialization for the mac_policy_ops 2002-10-30 18:48:51 +00:00
mac_stub Move to C99 sparse structure initialization for the mac_policy_ops 2002-10-30 18:48:51 +00:00
mac_test Move to C99 sparse structure initialization for the mac_policy_ops 2002-10-30 18:48:51 +00:00