Remove unnecessary lock usage

This commit is contained in:
topjohnwu 2024-02-24 04:20:28 -08:00
parent f8967e9274
commit 66f49dfab5
3 changed files with 5 additions and 13 deletions

View File

@ -24,10 +24,7 @@ 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 *;

View File

@ -26,9 +26,11 @@ void sepolicy::magisk_rules() {
allow(SEPOL_PROC_DOMAIN, ALL, ALL, ALL);
// Allow us to do any ioctl
if (impl->db->policyvers >= POLICYDB_VERSION_XPERMS_IOCTL) {
allowxperm(SEPOL_PROC_DOMAIN, ALL, "blk_file", ALL_XPERM);
allowxperm(SEPOL_PROC_DOMAIN, ALL, "fifo_file", ALL_XPERM);
allowxperm(SEPOL_PROC_DOMAIN, ALL, "chr_file", ALL_XPERM);
argument all;
all.first.push_back(nullptr);
allowxperm(SEPOL_PROC_DOMAIN, ALL, "blk_file", all);
allowxperm(SEPOL_PROC_DOMAIN, ALL, "fifo_file", all);
allowxperm(SEPOL_PROC_DOMAIN, ALL, "chr_file", all);
}
// Create unconstrained file type

View File

@ -8,13 +8,6 @@
using namespace std;
const argument &all_xperm() {
static argument arg;
if (arg.first.empty())
arg.first.push_back(nullptr);
return arg;
}
static const char *type_msg_1 =
R"EOF("allow *source_type *target_type *class *perm_set"
"deny *source_type *target_type *class *perm_set"