From d7158131e4fd0869b03b1446afbb742bc6f3d6e9 Mon Sep 17 00:00:00 2001 From: LoveSy Date: Sun, 26 Feb 2023 12:22:11 +0800 Subject: [PATCH] No need to manually parse mount flags --- native/src/core/bootstages.cpp | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/native/src/core/bootstages.cpp b/native/src/core/bootstages.cpp index 6014831a0..c294ac278 100644 --- a/native/src/core/bootstages.cpp +++ b/native/src/core/bootstages.cpp @@ -1,7 +1,6 @@ #include #include #include -#include #include #include #include @@ -71,19 +70,7 @@ static void mount_mirrors() { LOGI("* Mounting module root\n"); if (access(SECURE_DIR, F_OK) == 0 || (SDK_INT < 24 && xmkdir(SECURE_DIR, 0700))) { if (auto dest = MAGISKTMP + "/" MODULEMNT; mount_mirror(MODULEROOT, dest)) { - // remount to clear nosuid flag - struct statvfs st{}; - statvfs(dest.data(), &st); - for (const auto &info: parse_mount_info("self")) { - if (info.target != dest) { - continue; - } - // strip rw, from fs options - if (auto pos = info.fs_option.find_first_of(','); pos != string::npos) { - xmount("", dest.data(), nullptr, MS_REMOUNT | (st.f_flag & ~MS_NOSUID), info.fs_option.data() + pos + 1); - } - break; - } + xmount(nullptr, dest.data(), nullptr, MS_REMOUNT | MS_BIND, nullptr); restorecon(); chmod(SECURE_DIR, 0700); }