Commit Graph

5 Commits

Author SHA1 Message Date
Kenton Groombridge 9f4afcc6e2 testing: accept '@' as a valid ending character in filecon checker
Signed-off-by: Kenton Groombridge <me@concord.sh>
2021-12-05 13:01:23 -05:00
Christian Goettsche 303857caca check_fc_files: allow optional @ character
Do not warn on /usr/lib/systemd/system/ssh@?\.service

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
2021-10-19 20:59:22 +02:00
Nicolas Iooss 8e612038de
testing/check_fc_files: allow @ character in file context patterns
Some systemd units use @ in their names.

Fixes: https://github.com/SELinuxProject/refpolicy/issues/131

Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
2019-12-22 16:53:05 +01:00
Nicolas Iooss 249dc50218
Allow using /([^/]+/)? and (/[^/]+)?/ in patterns
These are valid expressions in the middle of a pattern in a .fc file, in
order to match an optional subdirectory level.

Some recent commits introduced "/([^/]+/)?" in the policy:
* commit b8f2c55109 ("cups: use ([^/]+/)? to match a subdirectory of
  CUPS configuration")
* commit 4b02c2230d ("authlogin: label utempter correctly on Debian")

Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
2019-09-08 22:58:15 +02:00
Nicolas Iooss f9deb94ba4
Check the .fc files for common typos
Writing .fc files without any mistake is quite hard. Sometimes a regular
expression pattern compiles fine but it does not match what is intended.

Add a script that detects some issues in .fc files. When this script is
used directly ("./testing/check_fc_files.py"), it checks the content of
policy/. The path to policy/ can also be provided by option -p.

Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
2019-09-01 15:05:23 +02:00