mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-07-28 21:33: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,9 +83,11 @@ pub(crate) fn restore_tmpcon() -> LoggedResult<()> {
|
||||
let mut path = cstr::buf::default();
|
||||
let mut dir = Directory::open(tmp)?;
|
||||
while let Some(ref e) = dir.read()? {
|
||||
if !e.is_symlink() {
|
||||
e.resolve_path(&mut path)?;
|
||||
path.set_secontext(SYSTEM_CON)?;
|
||||
}
|
||||
}
|
||||
|
||||
path.clear();
|
||||
path.append_path(tmp).append_path(LOG_PIPE);
|
||||
|
Loading…
x
Reference in New Issue
Block a user