selinux/checkpolicy
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
..
test libsepol,checkpolicy: convert rangetrans and filenametrans to hashtabs 2016-11-28 13:10:59 -05:00
.gitignore Repo: update .gitignore 2011-08-02 13:31:51 -04:00
COPYING initial import from svn trunk revision 2950 2008-08-19 15:30:36 -04:00
Makefile checkpolicy: set flex as default lexer 2016-05-19 14:16:04 -04:00
VERSION Update VERSION and ChangeLog files for 2.6 final release. 2016-10-14 11:31:26 -04:00
checkmodule.8 checkpolicy: Add support for generating CIL 2015-04-01 13:09:26 -04:00
checkmodule.c checkpolicy: Fix checkmodule output message 2016-05-16 16:33:29 -04:00
checkpolicy.8 checkpolicy: Add support for generating CIL 2015-04-01 13:09:26 -04:00
checkpolicy.c libsepol,checkpolicy,secilc: Replace #ifdef DARWIN with __APPLE__. 2016-05-03 11:54:20 -04:00
checkpolicy.h initial import from svn trunk revision 2950 2008-08-19 15:30:36 -04:00
module_compiler.c Fix -Wreturn-type issues. 2015-06-12 08:35:22 -04:00
module_compiler.h checkpolicy: Separate tunable from boolean during compile. 2011-09-16 11:54:01 -04:00
parse_util.c initial import from svn trunk revision 2950 2008-08-19 15:30:36 -04:00
parse_util.h initial import from svn trunk revision 2950 2008-08-19 15:30:36 -04:00
policy_define.c libsepol,checkpolicy: convert rangetrans and filenametrans to hashtabs 2016-11-28 13:10:59 -05:00
policy_define.h checkpolicy: switch operations to extended perms 2015-06-15 09:21:20 -04:00
policy_parse.y Add neverallow support for ioctl extended permissions 2015-09-22 10:52:47 -04:00
policy_scan.l Extend checkpolicy pathname matching. 2016-07-14 11:41:28 -04:00
queue.c initial import from svn trunk revision 2950 2008-08-19 15:30:36 -04:00
queue.h initial import from svn trunk revision 2950 2008-08-19 15:30:36 -04:00