uid_sanner: Ensure the /data/misc/user_uid/ directory is set to 777 permissions to prevent read/write issues.

This commit is contained in:
ShirkNeko
2025-09-20 00:27:48 +08:00
parent e27d461eb0
commit 452fe3d508

View File

@@ -209,7 +209,19 @@ int retry_operation(int (*operation)(void), const char *op_name) {
}
void ensure_directory_exists(void) {
system("mkdir -p /data/misc/user_uid");
const char *path = "/data/misc/user_uid";
struct stat st;
if (stat(path, &st) != 0) {
if (mkdir(path, 0777) != 0) {
LOGE("Failed to create directory %s: %s", path, strerror(errno));
return;
}
}
if (chmod(path, 0777) != 0) {
LOGE("Failed to chmod directory %s: %s", path, strerror(errno));
}
}
void parse_config_line(const char *key, const char *value) {