mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-11-24 10:35:26 +00:00
Do not follow symlink when checking legacy paths
This commit is contained in:
parent
ab74290fe3
commit
77fd5fa7de
@ -507,11 +507,11 @@ static bool prepare_img() {
|
||||
|
||||
// Migrate legacy boot scripts
|
||||
struct stat st;
|
||||
if (stat(LEGACY_CORE "/post-fs-data.d", &st) == 0 && S_ISDIR(st.st_mode)) {
|
||||
if (lstat(LEGACY_CORE "/post-fs-data.d", &st) == 0 && S_ISDIR(st.st_mode)) {
|
||||
cp_afc(LEGACY_CORE "/post-fs-data.d", SECURE_DIR "/post-fs-data.d");
|
||||
rm_rf(LEGACY_CORE "/post-fs-data.d");
|
||||
}
|
||||
if (stat(LEGACY_CORE "/service.d", &st) == 0 && S_ISDIR(st.st_mode)) {
|
||||
if (lstat(LEGACY_CORE "/service.d", &st) == 0 && S_ISDIR(st.st_mode)) {
|
||||
cp_afc(LEGACY_CORE "/service.d", SECURE_DIR "/service.d");
|
||||
rm_rf(LEGACY_CORE "/service.d");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user