mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-10-16 14:30:03 +00:00
Use SO_PEERSEC to get client secontext
This commit is contained in:
@@ -25,7 +25,7 @@ Actions:
|
||||
exit(1);
|
||||
}
|
||||
|
||||
void denylist_handler(int client, ucred *cred) {
|
||||
void denylist_handler(int client, const sock_cred *cred) {
|
||||
if (client < 0) {
|
||||
revert_unmount();
|
||||
return;
|
||||
|
@@ -243,7 +243,7 @@ int remote_request_unmount() {
|
||||
|
||||
// The following code runs in magiskd
|
||||
|
||||
static void setup_files(int client, ucred *cred) {
|
||||
static void setup_files(int client, const sock_cred *cred) {
|
||||
LOGD("zygisk: setup files for pid=[%d]\n", cred->pid);
|
||||
|
||||
char buf[256];
|
||||
@@ -265,7 +265,7 @@ static void setup_files(int client, ucred *cred) {
|
||||
int cached_manager_app_id = -1;
|
||||
static time_t last_modified = 0;
|
||||
|
||||
static void get_process_info(int client, ucred *cred) {
|
||||
static void get_process_info(int client, const sock_cred *cred) {
|
||||
AppInfo info{};
|
||||
int uid = read_int(client);
|
||||
string process = read_string(client);
|
||||
@@ -315,7 +315,7 @@ static void get_process_info(int client, ucred *cred) {
|
||||
}
|
||||
}
|
||||
|
||||
static void do_unmount(int client, ucred *cred) {
|
||||
static void do_unmount(int client, const sock_cred *cred) {
|
||||
if (denylist_enabled) {
|
||||
LOGD("zygisk: cleanup mount namespace for pid=[%d]\n", cred->pid);
|
||||
revert_daemon(cred->pid, client);
|
||||
@@ -334,7 +334,7 @@ static void send_log_pipe(int fd) {
|
||||
}
|
||||
}
|
||||
|
||||
void zygisk_handler(int client, ucred *cred) {
|
||||
void zygisk_handler(int client, const sock_cred *cred) {
|
||||
int code = read_int(client);
|
||||
switch (code) {
|
||||
case ZYGISK_SETUP:
|
||||
|
Reference in New Issue
Block a user