Commit graph

2 commits

Author SHA1 Message Date
Joel Galenson
b5806c47c5 Add code to check for unescaped periods in file_contexts.
Test: Run script and find unescaped periods.
Change-Id: I35a4366aa576d5c6036d0dcfb068ca4e0f27fff9
2018-10-06 13:39:38 -07:00
Joel Galenson
c43273162f Add a script to check for ways to cleanup SELinux policy.
This scripts checks for common problems with SELinux policy,
including:
- Declared types that are not assigned to any files
- Files that don't exist on a running device
- Rules defined in the wrong file
- Using the wrong version of _file_perms/_dir_perms

These are heuristics, mainly because it does not fully parse regular
expressions and because policy might still be needed even if the
relevant file does not exist on a single device.  But it hopefully is
a start at helping cleanup policy.

Bug: 30003114
Bug: 70702017
Test: Run script on core and device-specific policy.
Test: Verify that most of its results are correct.
Change-Id: I1ded4e9b18816841198dcbf72da65f046441d626
2018-08-31 13:55:34 -07:00