2020-05-23 09:18:25 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <sepol/policydb/policydb.h>
|
|
|
|
#include <magiskpolicy.hpp>
|
|
|
|
|
|
|
|
// Internal APIs, do not use directly
|
|
|
|
struct sepol_impl : public sepolicy {
|
|
|
|
void check_avtab_node(avtab_ptr_t node);
|
|
|
|
avtab_ptr_t get_avtab_node(avtab_key_t *key, avtab_extended_perms_t *xperms);
|
2020-05-24 14:41:19 +02:00
|
|
|
bool add_rule(const char *s, const char *t, const char *c, const char *p, int effect, bool invert);
|
|
|
|
void add_rule(type_datum_t *src, type_datum_t *tgt, class_datum_t *cls, perm_datum_t *perm, int effect, bool invert);
|
2020-05-24 13:16:40 +02:00
|
|
|
void add_xperm_rule(type_datum_t *src, type_datum_t *tgt,
|
2020-05-24 14:41:19 +02:00
|
|
|
class_datum_t *cls, uint16_t low, uint16_t high, int effect, bool invert);
|
|
|
|
bool add_xperm_rule(const char *s, const char *t, const char *c, const char *range, int effect, bool invert);
|
2020-05-24 13:16:40 +02:00
|
|
|
bool add_type_rule(const char *s, const char *t, const char *c, const char *d, int effect);
|
|
|
|
bool add_filename_trans(const char *s, const char *t, const char *c, const char *d, const char *o);
|
|
|
|
bool add_genfscon(const char *fs_name, const char *path, const char *context);
|
2020-05-25 11:09:43 +02:00
|
|
|
bool add_type(const char *type_name, uint32_t flavor);
|
|
|
|
bool set_type_state(const char *type_name, bool permissive);
|
|
|
|
void add_typeattribute(type_datum_t *type, type_datum_t *attr);
|
2020-05-24 13:16:40 +02:00
|
|
|
bool add_typeattribute(const char *type, const char *attr);
|
2020-05-23 09:18:25 +02:00
|
|
|
void strip_dontaudit();
|
|
|
|
};
|
|
|
|
|
|
|
|
#define impl static_cast<sepol_impl *>(this)
|
|
|
|
|
|
|
|
void statement_help();
|