mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-12-03 11:31:53 +00:00
Update magiskpolicy
- Generalize avtab node extraction and insertion - Add new supported rules: type_change, type_member - Update help message with official policy language
This commit is contained in:
@@ -21,16 +21,6 @@ int sepol_auditdeny(const char *s, const char *t, const char *c, const char *p)
|
||||
return add_rule(s, t, c, p, AVTAB_AUDITDENY, 0);
|
||||
}
|
||||
|
||||
int sepol_typetrans(const char *s, const char *t, const char *c, const char *d, const char *o) {
|
||||
if (o == nullptr) {
|
||||
// printf("add_trans %s %s %s %s\n", s, t, c ,d);
|
||||
return add_transition(s, t, c, d);
|
||||
} else {
|
||||
// printf("add_file_trans %s %s %s %s %s\n", s, t, c ,d, o);
|
||||
return add_file_transition(s, t, c, d, o);
|
||||
}
|
||||
}
|
||||
|
||||
int sepol_allowxperm(const char *s, const char *t, const char *c, const char *range) {
|
||||
// printf("allowxperm %s %s %s %s\n", s, t, c, range);
|
||||
return add_xperm_rule(s, t, c, range, AVTAB_XPERMS_ALLOWED, 0);
|
||||
@@ -46,6 +36,21 @@ int sepol_dontauditxperm(const char *s, const char *t, const char *c, const char
|
||||
return add_xperm_rule(s, t, c, range, AVTAB_XPERMS_DONTAUDIT, 0);
|
||||
}
|
||||
|
||||
int sepol_typetrans(const char *s, const char *t, const char *c, const char *d) {
|
||||
// printf("type_transition %s %s %s %s\n", s, t, c, d);
|
||||
return add_type_rule(s, t, c, d, AVTAB_TRANSITION);
|
||||
}
|
||||
|
||||
int sepol_typechange(const char *s, const char *t, const char *c, const char *d) {
|
||||
// printf("type_change %s %s %s %s\n", s, t, c, d);
|
||||
return add_type_rule(s, t, c, d, AVTAB_CHANGE);
|
||||
}
|
||||
|
||||
int sepol_typemember(const char *s, const char *t, const char *c, const char *d) {
|
||||
// printf("type_member %s %s %s %s\n", s, t, c, d);
|
||||
return add_type_rule(s, t, c, d, AVTAB_MEMBER);
|
||||
}
|
||||
|
||||
int sepol_permissive(const char *s) {
|
||||
// printf("permissive %s\n", s);
|
||||
return set_domain_state(s, 1);
|
||||
|
||||
Reference in New Issue
Block a user