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
1ca9ec38
Commit
1ca9ec38
authored
Aug 19, 2017
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix typo in cloning attribute
parent
9522255e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
9 deletions
+7
-9
misc.c
jni/utils/misc.c
+7
-9
No files found.
jni/utils/misc.c
View file @
1ca9ec38
...
@@ -369,14 +369,12 @@ int rm_rf(const char *target) {
...
@@ -369,14 +369,12 @@ int rm_rf(const char *target) {
}
}
void
clone_attr
(
const
char
*
source
,
const
char
*
target
)
{
void
clone_attr
(
const
char
*
source
,
const
char
*
target
)
{
struct
stat
buf
;
int
sourcefd
,
targetfd
;
xstat
(
source
,
&
buf
);
sourcefd
=
xopen
(
source
,
O_RDONLY
);
chmod
(
target
,
buf
.
st_mode
&
0777
);
targetfd
=
xopen
(
target
,
O_RDONLY
);
chown
(
target
,
buf
.
st_uid
,
buf
.
st_gid
);
fclone_attr
(
sourcefd
,
targetfd
);
char
*
con
;
close
(
sourcefd
);
lgetfilecon
(
source
,
&
con
);
close
(
targetfd
);
lsetfilecon
(
target
,
con
);
free
(
con
);
}
}
void
fclone_attr
(
const
int
sourcefd
,
const
int
targetfd
)
{
void
fclone_attr
(
const
int
sourcefd
,
const
int
targetfd
)
{
...
@@ -386,7 +384,7 @@ void fclone_attr(const int sourcefd, const int targetfd) {
...
@@ -386,7 +384,7 @@ void fclone_attr(const int sourcefd, const int targetfd) {
fchown
(
targetfd
,
buf
.
st_uid
,
buf
.
st_gid
);
fchown
(
targetfd
,
buf
.
st_uid
,
buf
.
st_gid
);
char
*
con
;
char
*
con
;
fgetfilecon
(
sourcefd
,
&
con
);
fgetfilecon
(
sourcefd
,
&
con
);
fsetfilecon
(
source
fd
,
con
);
fsetfilecon
(
target
fd
,
con
);
free
(
con
);
free
(
con
);
}
}
...
...
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