mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-07-28 21:23:37 +00:00
Skip symlink in restore_tmpcon()
If magisktmp is /sbin, there may exist files which is symlink to files in root dir. As root is RO, setcontext will fail and break iterating loop.
This commit is contained in:
parent
1460317ebd
commit
39f2940bd1
@ -83,8 +83,10 @@ pub(crate) fn restore_tmpcon() -> LoggedResult<()> {
|
|||||||
let mut path = cstr::buf::default();
|
let mut path = cstr::buf::default();
|
||||||
let mut dir = Directory::open(tmp)?;
|
let mut dir = Directory::open(tmp)?;
|
||||||
while let Some(ref e) = dir.read()? {
|
while let Some(ref e) = dir.read()? {
|
||||||
e.resolve_path(&mut path)?;
|
if !e.is_symlink() {
|
||||||
path.set_secontext(SYSTEM_CON)?;
|
e.resolve_path(&mut path)?;
|
||||||
|
path.set_secontext(SYSTEM_CON)?;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
path.clear();
|
path.clear();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user