forked from MarcoBuster/Magisk
Set proper selinux context for /sbin re-link
This commit is contained in:
parent
e5b704eb32
commit
e33a5eb307
@ -78,10 +78,14 @@ void relink_sbin() {
|
||||
dir = xopendir("/sbin_orig");
|
||||
|
||||
while ((entry = xreaddir(dir))) {
|
||||
snprintf(from, sizeof(from), "%s/%s", "/sbin_orig", entry->d_name);
|
||||
snprintf(to, sizeof(to), "%s/%s", "/dev/sbin_bind", entry->d_name);
|
||||
if (strcmp(entry->d_name, "..") == 0)
|
||||
continue;
|
||||
snprintf(from, sizeof(from), "/sbin_orig/%s", entry->d_name);
|
||||
if (entry->d_type == DT_LNK)
|
||||
xreadlink(from, from, sizeof(from));
|
||||
snprintf(to, sizeof(to), "/dev/sbin_bind/%s", entry->d_name);
|
||||
symlink(from, to);
|
||||
lsetfilecon(to, "u:object_r:system_file:s0");
|
||||
lsetfilecon(to, "u:object_r:rootfs:s0");
|
||||
}
|
||||
|
||||
closedir(dir);
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 4c7e081e158b1d6a56a76b98f61d880f3d8a994d
|
||||
Subproject commit c1c6f55f8f51cd24b5f926059e32d4a70a422430
|
Loading…
Reference in New Issue
Block a user