Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
M
Magisk
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Magisk
Commits
0efa73d9
Commit
0efa73d9
authored
May 23, 2020
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update selinux libs
parent
63512b39
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
11 deletions
+38
-11
selinux
native/jni/external/selinux
+1
-1
sepolicy.cpp
native/jni/magiskpolicy/sepolicy.cpp
+37
-10
No files found.
selinux
@
a54be053
Subproject commit
f3ed885ca09143d2f08f50f49c761e9afc5b3301
Subproject commit
a54be053299c04658d64229468a004ca40b6b4d5
native/jni/magiskpolicy/sepolicy.cpp
View file @
0efa73d9
...
...
@@ -19,6 +19,18 @@ static void dprint(const char *action, Args ...args) {
#define dprint(...)
#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
>
struct
auto_cast_wrapper
{
...
...
@@ -54,16 +66,31 @@ hash_for_each((hashtab)->htable, (hashtab)->size, fn)
#define avtab_for_each(avtab, fn) \
hash_for_each((avtab)->htable, (avtab)->nslot, fn)
// libsepol internal APIs
extern
"C"
int
policydb_index_decls
(
sepol_handle_t
*
handle
,
policydb_t
*
p
);
extern
"C"
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
);
extern
"C"
int
type_set_expand
(
type_set_t
*
set
,
ebitmap_t
*
t
,
policydb_t
*
p
,
unsigned
char
alwaysexpand
);
static
int
avtab_remove_node
(
avtab_t
*
h
,
avtab_ptr_t
node
)
{
if
(
!
h
||
!
h
->
htable
)
return
SEPOL_ENOMEM
;
int
hvalue
=
avtab_hash
(
&
node
->
key
,
h
->
mask
);
avtab_ptr_t
prev
,
cur
;
for
(
prev
=
nullptr
,
cur
=
h
->
htable
[
hvalue
];
cur
;
prev
=
cur
,
cur
=
cur
->
next
)
{
if
(
cur
==
node
)
break
;
}
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
)
{
type_datum_t
*
attr
=
hashtab_find
(
db
->
p_types
.
table
,
attr_name
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment