From 2468f5a6c4661d1cfe591511717bd56580a4e0ca Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Wed, 22 Apr 2020 23:01:11 -0700 Subject: [PATCH] Fix custom sepolicy patches --- native/jni/init/rootdir.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/native/jni/init/rootdir.cpp b/native/jni/init/rootdir.cpp index 71ea627c5..2f4b4af95 100644 --- a/native/jni/init/rootdir.cpp +++ b/native/jni/init/rootdir.cpp @@ -144,7 +144,7 @@ bool MagiskInit::patch_sepolicy(const char *file) { sepol_allow(SEPOL_PROC_DOMAIN, ALL, ALL, ALL); // Custom rules - if (auto dir = xopen_dir(persist_dir.data()); dir) { + if (auto dir = open_dir(persist_dir.data()); dir) { for (dirent *entry; (entry = xreaddir(dir.get()));) { auto rule = persist_dir + "/" + entry->d_name + "/sepolicy.rule"; if (access(rule.data(), R_OK) == 0) { @@ -238,7 +238,7 @@ void SARBase::patch_rootdir() { } setup_tmp(tmp_dir, self, config); - persist_dir = string(tmp_dir) + "/" MIRRDIR "/persist"; + persist_dir = MIRRDIR "/persist/magisk"; chdir(tmp_dir);