From 4709a326419a51233a2e7113a3f4f8acd7ecdb8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=97=E5=AE=AB=E9=9B=AA=E7=8F=8A?= Date: Tue, 7 Mar 2023 17:47:26 +0800 Subject: [PATCH] Fix mkdir Co-authored-by: LoveSy --- native/src/core/bootstages.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/native/src/core/bootstages.cpp b/native/src/core/bootstages.cpp index 7c0f0a5fe..d80f0c460 100644 --- a/native/src/core/bootstages.cpp +++ b/native/src/core/bootstages.cpp @@ -47,10 +47,13 @@ static void mount_mirrors() { LOGI("* Mounting mirrors\n"); // Bind remount module root to clear nosuid - if (access(SECURE_DIR, F_OK) == 0 || (SDK_INT < 24 && xmkdir(SECURE_DIR, 0700))) { + if (access(SECURE_DIR, F_OK) == 0 || SDK_INT < 24) { auto dest = MAGISKTMP + "/" MODULEMNT; + xmkdir(SECURE_DIR, 0700); + xmkdir(MODULEROOT, 0755); + xmkdir(dest.data(), 0755); xmount(MODULEROOT, dest.data(), nullptr, MS_BIND, nullptr); - xmount(nullptr, dest.data(), nullptr, MS_REMOUNT | MS_BIND, nullptr); + xmount(nullptr, dest.data(), nullptr, MS_REMOUNT | MS_BIND | MS_NOATIME, nullptr); xmount(nullptr, dest.data(), nullptr, MS_PRIVATE, nullptr); chmod(SECURE_DIR, 0700); restorecon(); @@ -112,7 +115,6 @@ static bool magisk_env() { // Directories in /data/adb xmkdir(DATABIN, 0755); - xmkdir(MODULEROOT, 0755); xmkdir(SECURE_DIR "/post-fs-data.d", 0755); xmkdir(SECURE_DIR "/service.d", 0755);