# Specify owner, group, and access bits for mobile-owned log directories
> /var/mobile/Library uid=501 gid=501 mode=0700
-> /var/mobile/Library/Logs uid=501 gid=501 mode=0755
-> /var/mobile/Library/Logs/CrashReporter uid=501 gid=501 mode=0755
+> /var/mobile/Library/Logs uid=501 gid=250 mode=0775
+> /var/mobile/Library/Logs/CrashReporter uid=501 gid=250 mode=0775
> /var/mobile/Library/Logs/CrashReporter/DiagnosticLogs uid=501 gid=501 mode=0755
#include <notify_keys.h>
#include <utmpx.h>
#include <asl_private.h>
-#include <pwd.h>
#if !TARGET_OS_IPHONE
#include <quarantine.h>
}
#endif
-#if TARGET_OS_IPHONE
- /*
- * Reset owner, group, and permissions in /var/mobile/Library/Logs
- * in case something created them incorrectly. syslogd was
- * guilty of this in the past, creating them with owner root.
- */
-
- 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);
-#endif
-
/* Set I/O policy */
setiopolicy_np(IOPOL_TYPE_DISK, IOPOL_SCOPE_PROCESS, IOPOL_PASSIVE);