- asl_secure_chown_chmod_dir("/private/var/mobile/Library/Logs", 501, 501, 0755);
- asl_secure_chown_chmod_dir("/private/var/mobile/Library/Logs/CrashReporter", 501, 501, 0755);
- asl_secure_chown_chmod_dir("/private/var/mobile/Library/Logs/CrashReporter/DiagnosticLogs", 501, 501, 0755);
+ uid_t __mUserUID = 501;
+ gid_t __mUserGID = 501;
+ struct passwd * pw = getpwnam("mobile");
+
+ if (pw) {
+ __mUserUID = pw->pw_uid;
+ __mUserGID = pw->pw_gid;
+ }
+
+ asl_secure_chown_chmod_dir("/private/var/mobile/Library/Logs", __mUserUID, __mUserGID, 0755);
+ asl_secure_chown_chmod_dir("/private/var/mobile/Library/Logs/CrashReporter", __mUserUID, __mUserGID, 0755);
+ asl_secure_chown_chmod_dir("/private/var/mobile/Library/Logs/CrashReporter/DiagnosticLogs", __mUserUID, __mUserGID, 0755);