Remove more pre SDK 21 stuffs

This commit is contained in:
topjohnwu
2021-04-09 21:29:42 -07:00
parent 1f0a35f073
commit 01b985eded
9 changed files with 15 additions and 48 deletions

View File

@ -36,7 +36,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);
void selinux_builtin_impl();
void dload_selinux();
void enable_selinux();
void restorecon();
void restore_tmpcon();

View File

@ -99,7 +99,7 @@ void setfilecon_at(int dirfd, const char *name, const char *con) {
lsetfilecon(path, con);
}
void selinux_builtin_impl() {
void enable_selinux() {
setcon = __setcon;
getfilecon = __getfilecon;
lgetfilecon = __lgetfilecon;
@ -108,13 +108,3 @@ void selinux_builtin_impl() {
lsetfilecon = __lsetfilecon;
fsetfilecon = __fsetfilecon;
}
void dload_selinux() {
if (access("/system/lib/libselinux.so", F_OK) && access("/system/lib64/libselinux.so", F_OK))
return;
/* We only check whether libselinux.so exists but don't dlopen.
* For some reason calling symbols returned from dlsym
* will result to SEGV_ACCERR on some devices.
* Always use builtin implementations for SELinux stuffs. */
selinux_builtin_impl();
}