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
c113f854
Commit
c113f854
authored
May 07, 2020
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix overlay.d on SAR again
parent
87de0e7a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
8 deletions
+10
-8
rootdir.cpp
native/jni/init/rootdir.cpp
+2
-2
files.cpp
native/jni/utils/files.cpp
+8
-6
No files found.
native/jni/init/rootdir.cpp
View file @
c113f854
...
...
@@ -316,8 +316,8 @@ void SARBase::patch_rootdir() {
// Handle overlay.d
load_overlay_rc
(
ROOTOVL
);
if
(
access
(
ROOTOVL
"/sbin"
,
F_OK
)
==
0
)
{
// Move files in overlay.d/sbin into
Magisk's
tmp_dir
mv_path
(
ROOTOVL
"/sbin"
,
tmp_dir
);
// Move files in overlay.d/sbin into tmp_dir
mv_path
(
ROOTOVL
"/sbin"
,
"."
);
}
// Patch init.rc
...
...
native/jni/utils/files.cpp
View file @
c113f854
...
...
@@ -86,11 +86,13 @@ void frm_rf(int dirfd) {
}
void
mv_path
(
const
char
*
src
,
const
char
*
dest
)
{
file_attr
a
;
getattr
(
src
,
&
a
);
if
(
S_ISDIR
(
a
.
st
.
st_mode
))
{
xmkdirs
(
dest
,
0
);
setattr
(
dest
,
&
a
);
file_attr
attr
;
getattr
(
src
,
&
attr
);
if
(
S_ISDIR
(
attr
.
st
.
st_mode
))
{
if
(
access
(
dest
,
F_OK
)
!=
0
)
{
xmkdirs
(
dest
,
0
);
setattr
(
dest
,
&
attr
);
}
mv_dir
(
xopen
(
src
,
O_RDONLY
|
O_CLOEXEC
),
xopen
(
dest
,
O_RDONLY
|
O_CLOEXEC
));
}
else
{
xrename
(
src
,
dest
);
...
...
@@ -100,7 +102,7 @@ void mv_path(const char *src, const char *dest) {
void
mv_dir
(
int
src
,
int
dest
)
{
auto
dir
=
xopen_dir
(
src
);
run_finally
f
([
&
]{
close
(
dest
);
});
run_finally
f
([
=
]{
close
(
dest
);
});
for
(
dirent
*
entry
;
(
entry
=
xreaddir
(
dir
.
get
()));)
{
switch
(
entry
->
d_type
)
{
case
DT_DIR
:
...
...
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