mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-05-19 23:57:07 +02:00
Update selinux libs
This commit is contained in:
parent
63512b39b2
commit
0efa73d96c
2
native/jni/external/selinux
vendored
2
native/jni/external/selinux
vendored
@ -1 +1 @@
|
|||||||
Subproject commit f3ed885ca09143d2f08f50f49c761e9afc5b3301
|
Subproject commit a54be053299c04658d64229468a004ca40b6b4d5
|
@ -19,6 +19,18 @@ static void dprint(const char *action, Args ...args) {
|
|||||||
#define dprint(...)
|
#define dprint(...)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// libsepol internal APIs
|
||||||
|
__BEGIN_DECLS
|
||||||
|
int policydb_index_decls(sepol_handle_t * handle, policydb_t * p);
|
||||||
|
int avtab_hash(struct avtab_key *keyp, uint32_t mask);
|
||||||
|
int type_set_expand(type_set_t * set, ebitmap_t * t, policydb_t * p, unsigned char alwaysexpand);
|
||||||
|
int context_from_string(
|
||||||
|
sepol_handle_t * handle,
|
||||||
|
const policydb_t * policydb,
|
||||||
|
context_struct_t ** cptr,
|
||||||
|
const char *con_str, size_t con_str_len);
|
||||||
|
__END_DECLS
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct auto_cast_wrapper
|
struct auto_cast_wrapper
|
||||||
{
|
{
|
||||||
@ -54,16 +66,31 @@ hash_for_each((hashtab)->htable, (hashtab)->size, fn)
|
|||||||
#define avtab_for_each(avtab, fn) \
|
#define avtab_for_each(avtab, fn) \
|
||||||
hash_for_each((avtab)->htable, (avtab)->nslot, fn)
|
hash_for_each((avtab)->htable, (avtab)->nslot, fn)
|
||||||
|
|
||||||
// libsepol internal APIs
|
static int avtab_remove_node(avtab_t *h, avtab_ptr_t node) {
|
||||||
extern "C" int policydb_index_decls(sepol_handle_t * handle, policydb_t * p);
|
if (!h || !h->htable)
|
||||||
extern "C" int context_from_string(
|
return SEPOL_ENOMEM;
|
||||||
sepol_handle_t * handle,
|
int hvalue = avtab_hash(&node->key, h->mask);
|
||||||
const policydb_t * policydb,
|
avtab_ptr_t prev, cur;
|
||||||
context_struct_t ** cptr,
|
for (prev = nullptr, cur = h->htable[hvalue]; cur; prev = cur, cur = cur->next) {
|
||||||
const char *con_str, size_t con_str_len);
|
if (cur == node)
|
||||||
extern "C" int type_set_expand(
|
break;
|
||||||
type_set_t * set, ebitmap_t * t, policydb_t * p,
|
}
|
||||||
unsigned char alwaysexpand);
|
if (cur == nullptr)
|
||||||
|
return SEPOL_ENOENT;
|
||||||
|
|
||||||
|
// Detach from hash table
|
||||||
|
if (prev)
|
||||||
|
prev->next = node->next;
|
||||||
|
else
|
||||||
|
h->htable[hvalue] = node->next;
|
||||||
|
h->nel--;
|
||||||
|
|
||||||
|
// Free memory
|
||||||
|
if (node->key.specified & AVTAB_XPERMS)
|
||||||
|
free(node->datum.xperms);
|
||||||
|
free(node);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int sepol_impl::set_attr(const char *attr_name, int type_val) {
|
int sepol_impl::set_attr(const char *attr_name, int type_val) {
|
||||||
type_datum_t *attr = hashtab_find(db->p_types.table, attr_name);
|
type_datum_t *attr = hashtab_find(db->p_types.table, attr_name);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user