mirror of
https://github.com/topjohnwu/Magisk.git
synced 2026-01-18 23:56:13 -08:00
Remove usage of MAGISKTMP
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include <magisk.hpp>
|
||||
#include <base.hpp>
|
||||
#include <selinux.hpp>
|
||||
#include <daemon.hpp>
|
||||
#include <flags.h>
|
||||
|
||||
using namespace std;
|
||||
@@ -121,17 +122,18 @@ void restorecon() {
|
||||
}
|
||||
|
||||
void restore_tmpcon() {
|
||||
if (MAGISKTMP == "/sbin")
|
||||
setfilecon(MAGISKTMP.data(), ROOT_CON);
|
||||
const char *tmp = get_magisk_tmp();
|
||||
if (tmp == "/sbin"sv)
|
||||
setfilecon(tmp, ROOT_CON);
|
||||
else
|
||||
chmod(MAGISKTMP.data(), 0711);
|
||||
chmod(tmp, 0711);
|
||||
|
||||
auto dir = xopen_dir(MAGISKTMP.data());
|
||||
auto dir = xopen_dir(tmp);
|
||||
int dfd = dirfd(dir.get());
|
||||
|
||||
for (dirent *entry; (entry = xreaddir(dir.get()));)
|
||||
setfilecon_at(dfd, entry->d_name, SYSTEM_CON);
|
||||
|
||||
string logd = MAGISKTMP + "/" LOG_PIPE;
|
||||
string logd = tmp + "/"s LOG_PIPE;
|
||||
setfilecon(logd.data(), MAGISK_FILE_CON);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user