2019-07-01 02:09:31 +00:00
|
|
|
#pragma once
|
2017-11-28 22:09:35 +00:00
|
|
|
|
|
|
|
#include <stdlib.h>
|
2019-03-15 10:17:37 +00:00
|
|
|
#include <selinux.h>
|
2017-11-28 22:09:35 +00:00
|
|
|
|
|
|
|
#define ALL NULL
|
|
|
|
|
|
|
|
// policydb functions
|
2019-03-15 10:17:37 +00:00
|
|
|
int load_policydb(const char *file);
|
|
|
|
int load_split_cil();
|
2018-07-20 21:12:22 +00:00
|
|
|
int compile_split_cil();
|
2019-03-15 10:17:37 +00:00
|
|
|
int dump_policydb(const char *file);
|
2017-11-28 22:09:35 +00:00
|
|
|
void destroy_policydb();
|
|
|
|
|
|
|
|
// Handy functions
|
2018-11-08 09:20:16 +00:00
|
|
|
int sepol_allow(const char *s, const char *t, const char *c, const char *p);
|
|
|
|
int sepol_deny(const char *s, const char *t, const char *c, const char *p);
|
|
|
|
int sepol_auditallow(const char *s, const char *t, const char *c, const char *p);
|
2018-11-29 11:42:04 +00:00
|
|
|
int sepol_dontaudit(const char *s, const char *t, const char *c, const char *p);
|
2018-11-29 08:46:29 +00:00
|
|
|
int sepol_typetrans(const char *s, const char *t, const char *c, const char *d);
|
|
|
|
int sepol_typechange(const char *s, const char *t, const char *c, const char *d);
|
|
|
|
int sepol_typemember(const char *s, const char *t, const char *c, const char *d);
|
|
|
|
int sepol_nametrans(const char *s, const char *t, const char *c, const char *d, const char *o);
|
2018-11-08 09:20:16 +00:00
|
|
|
int sepol_allowxperm(const char *s, const char *t, const char *c, const char *range);
|
|
|
|
int sepol_auditallowxperm(const char *s, const char *t, const char *c, const char *range);
|
|
|
|
int sepol_dontauditxperm(const char *s, const char *t, const char *c, const char *range);
|
|
|
|
int sepol_create(const char *s);
|
|
|
|
int sepol_permissive(const char *s);
|
|
|
|
int sepol_enforce(const char *s);
|
|
|
|
int sepol_attradd(const char *s, const char *a);
|
2020-02-01 17:16:42 +00:00
|
|
|
int sepol_genfscon(const char *name, const char *path, const char *context);
|
2018-11-08 09:20:16 +00:00
|
|
|
int sepol_exists(const char *source);
|
2017-11-28 22:09:35 +00:00
|
|
|
|
|
|
|
// Built in rules
|
|
|
|
void sepol_magisk_rules();
|
2019-12-09 09:14:30 +00:00
|
|
|
|
|
|
|
// Statement parsing
|
|
|
|
void parse_statement(const char *statement);
|
|
|
|
void load_rule_file(const char *file);
|
|
|
|
void statement_help();
|