mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-06-13 05:37:47 +02:00
Move su request path to magisk tmp
This commit is contained in:
@ -3,11 +3,10 @@
|
||||
|
||||
#include <base.hpp>
|
||||
#include <selinux.hpp>
|
||||
#include <magisk.hpp>
|
||||
|
||||
#include "su.hpp"
|
||||
|
||||
extern int SDK_INT;
|
||||
|
||||
using namespace std;
|
||||
|
||||
#define CALL_PROVIDER \
|
||||
@ -193,14 +192,15 @@ void app_notify(const su_context &ctx) {
|
||||
int app_request(const su_context &ctx) {
|
||||
// Create FIFO
|
||||
char fifo[64];
|
||||
ssprintf(fifo, sizeof(fifo), "/dev/socket/magisk_su_request_%d", ctx.pid);
|
||||
ssprintf(fifo, sizeof(fifo), "%s/" INTLROOT "/su_request_%d", MAGISKTMP.data(), ctx.pid);
|
||||
mkfifo(fifo, 0600);
|
||||
chown(fifo, ctx.info->mgr_uid, ctx.info->mgr_uid);
|
||||
setfilecon(fifo, MAGISK_FILE_CON);
|
||||
|
||||
// Send request
|
||||
vector<Extra> extras;
|
||||
extras.reserve(2);
|
||||
extras.reserve(3);
|
||||
extras.emplace_back("fifo", fifo);
|
||||
extras.emplace_back("uid", ctx.info->eval_uid);
|
||||
extras.emplace_back("pid", ctx.pid);
|
||||
exec_cmd("request", extras, ctx.info, false);
|
||||
|
@ -265,7 +265,7 @@ void MagiskInit::setup_tmp(const char *path) {
|
||||
LOGD("Setup Magisk tmp at %s\n", path);
|
||||
chdir("/data");
|
||||
|
||||
xmkdir(INTLROOT, 0755);
|
||||
xmkdir(INTLROOT, 0711);
|
||||
xmkdir(MIRRDIR, 0);
|
||||
xmkdir(BLOCKDIR, 0);
|
||||
xmkdir(WORKERDIR, 0);
|
||||
|
Reference in New Issue
Block a user