SELinuxProject / selint

Static code analysis of refpolicy style SELinux policy
Apache License 2.0
38 stars 17 forks source link

Missing support for IFNDEF statements #256

Closed vmojzis closed 1 year ago

vmojzis commented 1 year ago
# git clone https://github.com/fedora-selinux/selinux-policy.git
# selint -s -r selinux-policy
selinux-policy/policy/modules/contrib/cockpit.if:13: (F): syntax error, unexpected IFNDEF, expecting end of file (F-001)
   13 | ifndef(`cockpit_ws_domtrans',`
      | ^~~~~~
Error: Failed to parse files

ifndef statements in .if files are supported by current upstream userspace.

dburgener commented 1 year ago

Thanks for the report.

At a quick glance in the parser, I think the issue applies to both ifdef and ifndef.

I think the fix should be pretty trivial, so I'll aim to get a PR up today.