mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-12-12 18:02:47 +00:00
Do not support systems without SELinux
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user