Remove UID check, not reliable....

This commit is contained in:
topjohnwu 2016-11-14 04:27:43 +08:00
parent f8fdaf5c1f
commit 0e69201f05

View File

@ -60,15 +60,15 @@ void lazy_unmount(const char* mountpoint) {
int hideMagisk(int pid, int uid) {
struct stat info;
char path[256];
snprintf(path, 256, "/proc/%d", pid);
if (stat(path, &info) == -1) {
fprintf(logfile, "MagiskHide: Unable to get info for pid=%d\n", pid);
return 1;
}
if (info.st_uid != uid) {
fprintf(logfile, "MagiskHide: Incorrect uid=%d, expect uid=%d\n", info.st_uid, uid);
return 1;
}
// snprintf(path, 256, "/proc/%d", pid);
// if (stat(path, &info) == -1) {
// fprintf(logfile, "MagiskHide: Unable to get info for pid=%d\n", pid);
// return 1;
// }
// if (info.st_uid != uid) {
// fprintf(logfile, "MagiskHide: Incorrect uid=%d, expect uid=%d\n", info.st_uid, uid);
// return 1;
// }
snprintf(path, 256, "/proc/%d/ns/mnt", pid);
int fd = open(path, O_RDONLY);