mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-12-13 13:51:49 +00:00
Deny init relabel to adb_data_file
Co-authored-by: 残页 <a1364259@163.com> Co-authored-by: LoveSy <shana@zju.edu.cn>
This commit is contained in:
@@ -18,7 +18,7 @@ static void restore_syscon(int dirfd) {
|
||||
char *con;
|
||||
|
||||
if (fgetfilecon(dirfd, &con) >= 0) {
|
||||
if (strlen(con) == 0 || strcmp(con, UNLABEL_CON) == 0 || strcmp(con, ADB_CON) == 0)
|
||||
if (strlen(con) == 0 || strcmp(con, UNLABEL_CON) == 0)
|
||||
fsetfilecon(dirfd, SYSTEM_CON);
|
||||
freecon(con);
|
||||
}
|
||||
@@ -31,13 +31,13 @@ static void restore_syscon(int dirfd) {
|
||||
continue;
|
||||
} else if (entry->d_type == DT_REG) {
|
||||
if (fgetfilecon(fd, &con) >= 0) {
|
||||
if (con[0] == '\0' || strcmp(con, UNLABEL_CON) == 0 || strcmp(con, ADB_CON) == 0)
|
||||
if (con[0] == '\0' || strcmp(con, UNLABEL_CON) == 0)
|
||||
fsetfilecon(fd, SYSTEM_CON);
|
||||
freecon(con);
|
||||
}
|
||||
} else if (entry->d_type == DT_LNK) {
|
||||
getfilecon_at(dirfd, entry->d_name, &con);
|
||||
if (con[0] == '\0' || strcmp(con, UNLABEL_CON) == 0 || strcmp(con, ADB_CON) == 0)
|
||||
if (con[0] == '\0' || strcmp(con, UNLABEL_CON) == 0)
|
||||
setfilecon_at(dirfd, entry->d_name, con);
|
||||
freecon(con);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user