Do not support systems without SELinux

This commit is contained in:
topjohnwu
2023-09-25 15:10:54 -07:00
parent ec115cd7e3
commit 5d07d0b964
6 changed files with 3 additions and 31 deletions
-4
View File
@@ -64,8 +64,6 @@ static void restore_syscon(int dirfd) {
}
void restorecon() {
if (!selinux_enabled())
return;
int fd = xopen(SELINUX_CONTEXT, O_WRONLY | O_CLOEXEC);
if (write(fd, ADB_CON, sizeof(ADB_CON)) >= 0)
lsetfilecon(SECURE_DIR, ADB_CON);
@@ -76,8 +74,6 @@ void restorecon() {
}
void restore_tmpcon() {
if (!selinux_enabled())
return;
if (MAGISKTMP == "/sbin")
setfilecon(MAGISKTMP.data(), ROOT_CON);
else