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
d19fcd5e
Commit
d19fcd5e
authored
May 29, 2022
by
vvb2060
Committed by
topjohnwu
May 29, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check path when start daemon
parent
c0981174
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
7 deletions
+8
-7
daemon.cpp
native/jni/core/daemon.cpp
+8
-0
restorecon.cpp
native/jni/core/restorecon.cpp
+0
-7
No files found.
native/jni/core/daemon.cpp
View file @
d19fcd5e
...
@@ -416,6 +416,14 @@ int connect_daemon(int req, bool create) {
...
@@ -416,6 +416,14 @@ int connect_daemon(int req, bool create) {
return
-
1
;
return
-
1
;
}
}
char
buf
[
64
];
xreadlink
(
"/proc/self/exe"
,
buf
,
sizeof
(
buf
));
if
(
str_starts
(
buf
,
"/system/bin/"
))
{
LOGE
(
"Start daemon on /dev or /sbin
\n
"
);
close
(
fd
);
return
-
1
;
}
if
(
fork_dont_care
()
==
0
)
{
if
(
fork_dont_care
()
==
0
)
{
close
(
fd
);
close
(
fd
);
daemon_entry
();
daemon_entry
();
...
...
native/jni/core/restorecon.cpp
View file @
d19fcd5e
...
@@ -76,13 +76,6 @@ void restorecon() {
...
@@ -76,13 +76,6 @@ void restorecon() {
}
}
void
restore_tmpcon
()
{
void
restore_tmpcon
()
{
if
(
MAGISKTMP
==
"/system/bin"
)
{
// Running with emulator.sh
if
(
SDK_INT
>=
26
)
lsetfilecon
(
"/system/bin/magisk"
,
EXEC_CON
);
return
;
}
if
(
MAGISKTMP
==
"/sbin"
)
if
(
MAGISKTMP
==
"/sbin"
)
setfilecon
(
MAGISKTMP
.
data
(),
ROOT_CON
);
setfilecon
(
MAGISKTMP
.
data
(),
ROOT_CON
);
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