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

View File

@@ -34,7 +34,6 @@ extern int (*fsetfilecon)(int fd, const char *con);
void getfilecon_at(int dirfd, const char *name, char **con);
void setfilecon_at(int dirfd, const char *name, const char *con);
bool selinux_enabled();
void enable_selinux();
void restorecon();
void restore_tmpcon();

View File

@@ -102,23 +102,7 @@ void setfilecon_at(int dirfd, const char *name, const char *con) {
lsetfilecon(path, con);
}
#if MAGISK_DEBUG
static bool se_state = false;
bool selinux_enabled() {
return se_state;
}
#else
bool selinux_enabled() {
return true;
}
#endif
void enable_selinux() {
#if MAGISK_DEBUG
if (access(SELINUX_MNT, F_OK) != 0)
return;
se_state = true;
#endif
setcon = __setcon;
getfilecon = __getfilecon;
lgetfilecon = __lgetfilecon;