mirror of
https://github.com/kvorschk/Magisk.git
synced 2026-12-05 03:20:46 -05:00
Migrate selinux.cpp to selinux.rs
This commit is contained in:
@@ -8,7 +8,6 @@
|
||||
#include <consts.hpp>
|
||||
#include <base.hpp>
|
||||
#include <core.hpp>
|
||||
#include <selinux.hpp>
|
||||
#include <flags.h>
|
||||
|
||||
using namespace std;
|
||||
@@ -339,6 +338,16 @@ static void switch_cgroup(const char *cgroup, int pid) {
|
||||
close(fd);
|
||||
}
|
||||
|
||||
static int setcon(const char *con) {
|
||||
int fd = open("/proc/self/attr/current", O_WRONLY | O_CLOEXEC);
|
||||
if (fd < 0)
|
||||
return fd;
|
||||
size_t len = strlen(con) + 1;
|
||||
int rc = write(fd, con, len);
|
||||
close(fd);
|
||||
return rc != len;
|
||||
}
|
||||
|
||||
static void daemon_entry() {
|
||||
android_logging();
|
||||
|
||||
@@ -383,8 +392,6 @@ static void daemon_entry() {
|
||||
set_prop("ro.vendor.mtk_model", "0");
|
||||
}
|
||||
|
||||
restore_tmpcon();
|
||||
|
||||
// Cleanups
|
||||
const char *tmp = get_magisk_tmp();
|
||||
char path[64];
|
||||
|
||||
Reference in New Issue
Block a user