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
9b170f2b
Commit
9b170f2b
authored
Nov 29, 2018
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Switch from deprecated AUDITDENY to DONTAUDIT
parent
51e9ff59
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
7 deletions
+8
-7
api.cpp
native/jni/magiskpolicy/api.cpp
+2
-2
magiskpolicy.cpp
native/jni/magiskpolicy/magiskpolicy.cpp
+3
-3
magiskpolicy.h
native/jni/magiskpolicy/magiskpolicy.h
+1
-1
sepolicy.c
native/jni/magiskpolicy/sepolicy.c
+2
-1
No files found.
native/jni/magiskpolicy/api.cpp
View file @
9b170f2b
...
@@ -16,8 +16,8 @@ int sepol_auditallow(const char *s, const char *t, const char *c, const char *p)
...
@@ -16,8 +16,8 @@ int sepol_auditallow(const char *s, const char *t, const char *c, const char *p)
return
add_rule
(
s
,
t
,
c
,
p
,
AVTAB_AUDITALLOW
,
0
);
return
add_rule
(
s
,
t
,
c
,
p
,
AVTAB_AUDITALLOW
,
0
);
}
}
int
sepol_
auditdeny
(
const
char
*
s
,
const
char
*
t
,
const
char
*
c
,
const
char
*
p
)
{
int
sepol_
dontaudit
(
const
char
*
s
,
const
char
*
t
,
const
char
*
c
,
const
char
*
p
)
{
// printf("
auditdeny
%s %s %s %s\n", s, t, c, p);
// printf("
dontaudit
%s %s %s %s\n", s, t, c, p);
return
add_rule
(
s
,
t
,
c
,
p
,
AVTAB_AUDITDENY
,
0
);
return
add_rule
(
s
,
t
,
c
,
p
,
AVTAB_AUDITDENY
,
0
);
}
}
...
...
native/jni/magiskpolicy/magiskpolicy.cpp
View file @
9b170f2b
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
static
const
char
*
type_msg_1
=
static
const
char
*
type_msg_1
=
"Type 1:
\n
"
"Type 1:
\n
"
"
\"
<rule_name> source_type target_type class perm_set
\"\n
"
"
\"
<rule_name> source_type target_type class perm_set
\"\n
"
"Rules: allow, deny, auditallow,
auditdeny
\n
"
;
"Rules: allow, deny, auditallow,
dontaudit
\n
"
;
static
const
char
*
type_msg_2
=
static
const
char
*
type_msg_2
=
"Type 2:
\n
"
"Type 2:
\n
"
...
@@ -135,7 +135,7 @@ static int parse_pattern_1(int action, const char *action_str, char *stmt) {
...
@@ -135,7 +135,7 @@ static int parse_pattern_1(int action, const char *action_str, char *stmt) {
action_func
=
sepol_auditallow
;
action_func
=
sepol_auditallow
;
break
;
break
;
case
3
:
case
3
:
action_func
=
sepol_
auditdeny
;
action_func
=
sepol_
dontaudit
;
break
;
break
;
default
:
default
:
return
1
;
return
1
;
...
@@ -418,7 +418,7 @@ static void parse_statement(char *statement) {
...
@@ -418,7 +418,7 @@ static void parse_statement(char *statement) {
add_action
(
"allow"
,
1
,
0
)
add_action
(
"allow"
,
1
,
0
)
add_action
(
"deny"
,
1
,
1
)
add_action
(
"deny"
,
1
,
1
)
add_action
(
"auditallow"
,
1
,
2
)
add_action
(
"auditallow"
,
1
,
2
)
add_action
(
"
auditdeny
"
,
1
,
3
)
add_action
(
"
dontaudit
"
,
1
,
3
)
add_action
(
"allowxperm"
,
2
,
0
)
add_action
(
"allowxperm"
,
2
,
0
)
add_action
(
"auditallowxperm"
,
2
,
1
)
add_action
(
"auditallowxperm"
,
2
,
1
)
add_action
(
"dontauditxperm"
,
2
,
2
)
add_action
(
"dontauditxperm"
,
2
,
2
)
...
...
native/jni/magiskpolicy/magiskpolicy.h
View file @
9b170f2b
...
@@ -30,7 +30,7 @@ void destroy_policydb();
...
@@ -30,7 +30,7 @@ void destroy_policydb();
int
sepol_allow
(
const
char
*
s
,
const
char
*
t
,
const
char
*
c
,
const
char
*
p
);
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_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
);
int
sepol_auditallow
(
const
char
*
s
,
const
char
*
t
,
const
char
*
c
,
const
char
*
p
);
int
sepol_
auditdeny
(
const
char
*
s
,
const
char
*
t
,
const
char
*
c
,
const
char
*
p
);
int
sepol_
dontaudit
(
const
char
*
s
,
const
char
*
t
,
const
char
*
c
,
const
char
*
p
);
int
sepol_typetrans
(
const
char
*
s
,
const
char
*
t
,
const
char
*
c
,
const
char
*
d
);
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_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_typemember
(
const
char
*
s
,
const
char
*
t
,
const
char
*
c
,
const
char
*
d
);
...
...
native/jni/magiskpolicy/sepolicy.c
View file @
9b170f2b
...
@@ -115,7 +115,8 @@ static avtab_ptr_t get_avtab_node(avtab_key_t *key, avtab_extended_perms_t *xper
...
@@ -115,7 +115,8 @@ static avtab_ptr_t get_avtab_node(avtab_key_t *key, avtab_extended_perms_t *xper
static
int
add_avrule
(
avtab_key_t
*
key
,
int
p
,
int
not
)
{
static
int
add_avrule
(
avtab_key_t
*
key
,
int
p
,
int
not
)
{
avtab_ptr_t
node
=
get_avtab_node
(
key
,
NULL
);
avtab_ptr_t
node
=
get_avtab_node
(
key
,
NULL
);
if
(
not
)
{
// Support DONTAUDIT (AUDITDENY is inverted)
if
(
AVTAB_AUDITDENY
==
node
->
key
.
specified
==
!
not
)
{
if
(
p
<
0
)
if
(
p
<
0
)
node
->
datum
.
data
=
0U
;
node
->
datum
.
data
=
0U
;
else
else
...
...
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