You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code is currently either always allowing or denying access in case the SELinux class or access vector is not defined.
IMVHO, this is not OK and you should use security_deny_unknown() after the calls to string_to_security_class() and string_to_av_perm() are failing.
The man page states:
security_deny_unknown() returns 0 if SELinux treats policy queries on undefined object classes or permissions as being allowed, 1 if such queries are denied, and -1 on error.
So it should be something like
tclass=string_to_security_class("file");
if (!tclass) {
log_it("CRON", getpid(), "ERROR", "Failed to translate security class file", errno);
if(security_deny_unknown() ==0)
return0;
elsereturn-1;
}
The text was updated successfully, but these errors were encountered:
Hello,
The code is currently either always allowing or denying access in case the SELinux class or access vector is not defined.
IMVHO, this is not OK and you should use
security_deny_unknown()
after the calls tostring_to_security_class()
andstring_to_av_perm()
are failing.The man page states:
So it should be something like
The text was updated successfully, but these errors were encountered: