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
c3586fe0
Commit
c3586fe0
authored
Sep 05, 2020
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upstream external/selinux
Fix #2645
parent
11f254e5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
9 deletions
+23
-9
selinux
native/jni/external/selinux
+1
-1
sepolicy.cpp
native/jni/magiskpolicy/sepolicy.cpp
+22
-8
No files found.
selinux
@
969114cf
Subproject commit
a54be053299c04658d64229468a004ca40b6b4d5
Subproject commit
969114cff6ee973f47a3c84cacdef77e504d7bd9
native/jni/magiskpolicy/sepolicy.cpp
View file @
c3586fe0
...
...
@@ -398,7 +398,6 @@ bool sepol_impl::add_type_rule(const char *s, const char *t, const char *c, cons
bool
sepol_impl
::
add_filename_trans
(
const
char
*
s
,
const
char
*
t
,
const
char
*
c
,
const
char
*
d
,
const
char
*
o
)
{
type_datum_t
*
src
,
*
tgt
,
*
def
;
class_datum_t
*
cls
;
filename_trans_datum_t
*
trans
;
src
=
hashtab_find
(
db
->
p_types
.
table
,
s
);
if
(
src
==
nullptr
)
{
...
...
@@ -421,22 +420,37 @@ bool sepol_impl::add_filename_trans(const char *s, const char *t, const char *c,
return
false
;
}
filename_trans_t
key
;
key
.
stype
=
src
->
s
.
value
;
filename_trans_key_t
key
;
key
.
ttype
=
tgt
->
s
.
value
;
key
.
tclass
=
cls
->
s
.
value
;
key
.
name
=
(
char
*
)
o
;
trans
=
hashtab_find
(
db
->
filename_trans
,
(
hashtab_key_t
)
&
key
);
filename_trans_datum_t
*
last
=
nullptr
;
filename_trans_datum_t
*
trans
=
hashtab_find
(
db
->
filename_trans
,
(
hashtab_key_t
)
&
key
);
while
(
trans
)
{
if
(
ebitmap_get_bit
(
&
trans
->
stypes
,
src
->
s
.
value
-
1
))
{
// Duplicate, overwrite existing data and return
trans
->
otype
=
def
->
s
.
value
;
return
true
;
}
if
(
trans
->
otype
==
def
->
s
.
value
)
break
;
last
=
trans
;
trans
=
trans
->
next
;
}
if
(
trans
==
nullptr
)
{
trans
=
auto_cast
(
xcalloc
(
sizeof
(
*
trans
),
1
));
hashtab_insert
(
db
->
filename_trans
,
(
hashtab_key_t
)
&
key
,
trans
);
filename_trans_key_t
*
new_key
=
auto_cast
(
malloc
(
sizeof
(
*
new_key
)));
*
new_key
=
key
;
new_key
->
name
=
strdup
(
key
.
name
);
trans
->
next
=
last
;
trans
->
otype
=
def
->
s
.
value
;
hashtab_insert
(
db
->
filename_trans
,
(
hashtab_key_t
)
new_key
,
trans
);
}
// Overwrite existing
trans
->
otype
=
def
->
s
.
value
;
return
true
;
db
->
filename_trans_count
++
;
return
ebitmap_set_bit
(
&
trans
->
stypes
,
src
->
s
.
value
-
1
,
1
)
==
0
;
}
bool
sepol_impl
::
add_genfscon
(
const
char
*
fs_name
,
const
char
*
path
,
const
char
*
context
)
{
...
...
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