Update xperm parsing

This commit is contained in:
topjohnwu
2023-07-31 09:28:27 -07:00
parent 9638dc0a66
commit 6089cc36de
6 changed files with 519 additions and 167 deletions
+11 -4
View File
@@ -5,7 +5,14 @@
#include <selinux.hpp>
#define ALL nullptr
using token_list = std::vector<const char *>;
using argument = std::pair<token_list, bool>;
using argument_list = std::vector<argument>;
const argument &all_xperm();
#define ALL nullptr
#define ALL_XPERM all_xperm()
struct sepolicy {
using c_str = const char *;
@@ -38,9 +45,9 @@ struct sepolicy {
bool dontaudit(c_str src, c_str tgt, c_str cls, c_str perm);
// Extended permissions access vector rules
bool allowxperm(c_str src, c_str tgt, c_str cls, c_str range);
bool auditallowxperm(c_str src, c_str tgt, c_str cls, c_str range);
bool dontauditxperm(c_str src, c_str tgt, c_str cls, c_str range);
bool allowxperm(c_str src, c_str tgt, c_str cls, const argument &xperm);
bool auditallowxperm(c_str src, c_str tgt, c_str cls, const argument &xperm);
bool dontauditxperm(c_str src, c_str tgt, c_str cls, const argument &xperm);
// Type rules
bool type_transition(c_str src, c_str tgt, c_str cls, c_str def, c_str obj = nullptr);