selinux/libsepol/include/sepol
Stephen Smalley 8fdb225521 libsepol,checkpolicy: convert rangetrans and filenametrans to hashtabs
range transition and name-based type transition rules were originally
simple unordered lists.  They were converted to hashtabs in the kernel
by commit 2f3e82d694d3d7a2db019db1bb63385fbc1066f3 ("selinux: convert range
transition list to a hashtab") and by commit
2463c26d50adc282d19317013ba0ff473823ca47 ("SELinux: put name based
create rules in a hashtable"), but left unchanged in libsepol and
checkpolicy. Convert libsepol and checkpolicy to use the same hashtabs
as the kernel for the range transitions and name-based type transitions.

With this change and the preceding one, it is possible to directly compare
a policy file generated by libsepol/checkpolicy and the kernel-generated
/sys/fs/selinux/policy pseudo file after normalizing them both through
checkpolicy.  To do so, you can run the following sequence of commands:

checkpolicy -M -b /etc/selinux/targeted/policy/policy.30 -o policy.1
checkpolicy -M -b /sys/fs/selinux/policy -o policy.2
cmp policy.1 policy.2

Normalizing the two files via checkpolicy is still necessary to ensure
consistent ordering of the avtab entries.  There may still be potential
for other areas of difference, e.g. xperms entries may lack a well-defined
order.

Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2016-11-28 13:10:59 -05:00
..
policydb libsepol,checkpolicy: convert rangetrans and filenametrans to hashtabs 2016-11-28 13:10:59 -05:00
boolean_record.h Allow libsepol C++ static library on device. 2015-01-20 10:31:15 -05:00
booleans.h Allow libsepol C++ static library on device. 2015-01-20 10:31:15 -05:00
context.h Allow libsepol C++ static library on device. 2015-01-20 10:31:15 -05:00
context_record.h Allow libsepol C++ static library on device. 2015-01-20 10:31:15 -05:00
debug.h Allow libsepol C++ static library on device. 2015-01-20 10:31:15 -05:00
errcodes.h Allow libsepol C++ static library on device. 2015-01-20 10:31:15 -05:00
handle.h Allow libsepol C++ static library on device. 2015-01-20 10:31:15 -05:00
iface_record.h Allow libsepol C++ static library on device. 2015-01-20 10:31:15 -05:00
interfaces.h Allow libsepol C++ static library on device. 2015-01-20 10:31:15 -05:00
module.h Allow libsepol C++ static library on device. 2015-01-20 10:31:15 -05:00
module_to_cil.h libsepol: add function to generate CIL from a module policydb 2015-04-01 13:09:21 -04:00
node_record.h Allow libsepol C++ static library on device. 2015-01-20 10:31:15 -05:00
nodes.h Allow libsepol C++ static library on device. 2015-01-20 10:31:15 -05:00
policydb.h Allow libsepol C++ static library on device. 2015-01-20 10:31:15 -05:00
port_record.h selinux: Add support for portcon dccp protocol 2016-04-06 10:14:27 -04:00
ports.h Allow libsepol C++ static library on device. 2015-01-20 10:31:15 -05:00
roles.h Allow libsepol C++ static library on device. 2015-01-20 10:31:15 -05:00
sepol.h Allow libsepol C++ static library on device. 2015-01-20 10:31:15 -05:00
user_record.h Allow libsepol C++ static library on device. 2015-01-20 10:31:15 -05:00
users.h Allow libsepol C++ static library on device. 2015-01-20 10:31:15 -05:00