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
2977dbcd
Commit
2977dbcd
authored
Nov 29, 2018
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove all dontaudit in magisk rules
parent
ac60b510
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
2 deletions
+18
-2
rules.cpp
native/jni/magiskpolicy/rules.cpp
+6
-0
sepolicy.c
native/jni/magiskpolicy/sepolicy.c
+11
-0
sepolicy.h
native/jni/magiskpolicy/sepolicy.h
+1
-2
No files found.
native/jni/magiskpolicy/rules.cpp
View file @
2977dbcd
...
...
@@ -165,4 +165,10 @@ void sepol_magisk_rules() {
// Allow update engine to source addon.d.sh
sepol_allow
(
"update_engine"
,
"adb_data_file"
,
"dir"
,
ALL
);
// Remove all dontaudit
for_each_avtab_node
([](
auto
p
)
->
void
{
if
(
p
->
key
.
specified
==
AVTAB_AUDITDENY
||
p
->
key
.
specified
==
AVTAB_XPERMS_DONTAUDIT
)
avtab_remove_node
(
&
policydb
->
te_avtab
,
p
);
});
}
native/jni/magiskpolicy/sepolicy.c
View file @
2977dbcd
...
...
@@ -406,6 +406,17 @@ int create_domain(const char *d) {
return
set_attr
(
"domain"
,
value
);
}
void
for_each_avtab_node
(
void
(
*
callback
)(
avtab_ptr_t
))
{
avtab_ptr_t
cur
,
next
;
for
(
int
i
=
0
;
i
<
policydb
->
te_avtab
.
nslot
;
++
i
)
{
for
(
cur
=
policydb
->
te_avtab
.
htable
[
i
];
cur
;
cur
=
next
)
{
// cur could be removed after callback
next
=
cur
->
next
;
callback
(
cur
);
}
}
}
int
set_domain_state
(
const
char
*
s
,
int
state
)
{
type_datum_t
*
type
;
hashtab_ptr_t
cur
;
...
...
native/jni/magiskpolicy/sepolicy.h
View file @
2977dbcd
...
...
@@ -19,10 +19,9 @@ extern policydb_t *policydb;
for (*ptr = table->htable[_i]; *ptr != NULL; *ptr = (*ptr)->next)
// sepolicy manipulation functions
void
for_each_avtab_node
(
void
(
*
callback
)(
avtab_ptr_t
));
int
create_domain
(
const
char
*
d
);
int
set_domain_state
(
const
char
*
s
,
int
state
);
int
add_file_transition
(
const
char
*
s
,
const
char
*
t
,
const
char
*
c
,
const
char
*
d
,
const
char
*
o
);
int
add_typeattribute
(
const
char
*
domainS
,
const
char
*
attr
);
int
add_rule
(
const
char
*
s
,
const
char
*
t
,
const
char
*
c
,
const
char
*
p
,
int
effect
,
int
n
);
int
add_xperm_rule
(
const
char
*
s
,
const
char
*
t
,
const
char
*
c
,
const
char
*
range
,
int
effect
,
int
n
);
...
...
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