#include <notify.h>
#include <notify_keys.h>
#include <utmpx.h>
-#include <vproc_priv.h>
#include <asl_private.h>
-#include <pwd.h>
#if !TARGET_OS_IPHONE
#include <quarantine.h>
#define NOTIFY_DELAY 1
-#define forever for(;;)
-
extern int _malloc_no_asl_log;
#if TARGET_IPHONE_SIMULATOR
}
#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);
dispatch_resume(global.mark_timer);
}
-#if !TARGET_IPHONE_SIMULATOR
- asldebug("starting launchd input channel\n");
- /*
- * Start launchd service
- * This pins a thread in _vprocmgr_log_drain. Eventually we will either
- * remove the whole stderr/stdout -> ASL mechanism entirely, or come up
- * with a communication channel that we can trigger with a dispatch source.
- */
- dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
- forever _vprocmgr_log_drain(NULL, NULL, launchd_callback);
- });
-#endif
-
asldebug("starting mach service\n");
/*
* Start mach server