ctc-oss / fapolicy-analyzer

Tools to assist with the configuration and management of fapolicyd.
https://ctc-oss.github.io/fapolicy-analyzer
GNU General Public License v3.0
12 stars 5 forks source link

Service valid check is not accurate #851

Closed jw3 closed 1 year ago

jw3 commented 1 year ago

The service valid check always reports true. The problem is that valid is based on the active state, assuming it errors if the service does not exist. Instead the active check returns inactive if it doesnt exist, the lack of error results in a valid state.

Example: This should (on most systems) print True, False, currently prints True, True

print(Handle("sshd").is_valid())
print(Handle("a_service_that_does_not_exist").is_valid())