From source_changes at macosforge.org Fri May 2 15:53:47 2008 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Fri May 2 15:55:16 2008 Subject: [launchd-changes] [23615] branches/SULeopard/launchd/src/launchd_runtime_kill.c Message-ID: <20080502225347.C4A1916270CE@beta.macosforge.org> Revision: 23615 http://trac.macosforge.org/projects/launchd/changeset/23615 Author: zarzycki@apple.com Date: 2008-05-02 15:53:47 -0700 (Fri, 02 May 2008) Log Message: ----------- launchd calls __kill() on arm Modified Paths: -------------- branches/SULeopard/launchd/src/launchd_runtime_kill.c Modified: branches/SULeopard/launchd/src/launchd_runtime_kill.c =================================================================== --- branches/SULeopard/launchd/src/launchd_runtime_kill.c 2008-04-30 21:32:53 UTC (rev 23614) +++ branches/SULeopard/launchd/src/launchd_runtime_kill.c 2008-05-02 22:53:47 UTC (rev 23615) @@ -18,36 +18,27 @@ * @APPLE_APACHE_LICENSE_HEADER_END@ */ -#if !defined(__LP64__) && !defined(__arm__) -#define _NONSTD_SOURCE 1 -#define old_kill(x, y) kill(x, y) -#define old_killpg(x, y) killpg(x, y) -#else -/* ??? No blessed way to get the old behavior */ -extern int __kill(int, int, int); -#define old_kill(x, y) __kill(x, y, 0) -#define old_killpg(x, y) __kill(-(x), y, 0) -#endif +#include +#include #include #include "launchd_runtime_kill.h" -/* - * POSIX defines consistency over correctness, and consequently kill/killpg now - * returns EPERM instead of ESRCH. - * - * I've filed 5487498 to get a non-portable kill() variant, but for now, - * defining _NONSTD_SOURCE gets us the old behavior. - */ - int runtime_kill(pid_t pid, int sig) { - return old_kill(pid, sig); + /* + * POSIX defines consistency over correctness, and consequently + * kill/killpg now returns EPERM instead of ESRCH. + * + * I've filed 5487498 to get a non-portable kill(). + * We'll regretfully take advantage of implementation details for now. + */ + return syscall(SYS_kill, pid, sig, 0); } int runtime_killpg(pid_t pgrp, int sig) { - return old_killpg(pgrp, sig); + return runtime_kill(-pgrp, sig); } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20080502/47b03d07/attachment.html From source_changes at macosforge.org Fri May 2 15:54:42 2008 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Fri May 2 15:55:39 2008 Subject: [launchd-changes] [23616] tags/launchd-258.14/ Message-ID: <20080502225442.2608116270ED@beta.macosforge.org> Revision: 23616 http://trac.macosforge.org/projects/launchd/changeset/23616 Author: zarzycki@apple.com Date: 2008-05-02 15:54:41 -0700 (Fri, 02 May 2008) Log Message: ----------- "Tagging launchd-258.14 from https://svn.macosforge.org/repository/launchd/branches/SULeopard" Added Paths: ----------- tags/launchd-258.14/ Copied: tags/launchd-258.14 (from rev 23615, branches/SULeopard) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20080502/52059ea3/attachment.html From source_changes at macosforge.org Fri May 2 15:58:06 2008 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Fri May 2 15:59:34 2008 Subject: [launchd-changes] [23617] trunk/launchd/src/launchd_runtime_kill.c Message-ID: <20080502225806.9973E162712C@beta.macosforge.org> Revision: 23617 http://trac.macosforge.org/projects/launchd/changeset/23617 Author: zarzycki@apple.com Date: 2008-05-02 15:58:06 -0700 (Fri, 02 May 2008) Log Message: ----------- launchd calls __kill() on arm Modified Paths: -------------- trunk/launchd/src/launchd_runtime_kill.c Modified: trunk/launchd/src/launchd_runtime_kill.c =================================================================== --- trunk/launchd/src/launchd_runtime_kill.c 2008-05-02 22:54:41 UTC (rev 23616) +++ trunk/launchd/src/launchd_runtime_kill.c 2008-05-02 22:58:06 UTC (rev 23617) @@ -18,40 +18,27 @@ * @APPLE_APACHE_LICENSE_HEADER_END@ */ -#if defined(__LP64__) -/* ??? No way to get the old behavior */ -#define old_kill(x, y) kill(x, y) -#define old_killpg(x, y) kill(-(x), y) -#elif defined(__arm__) -/* ??? No blessed way to get the old behavior */ -extern int __kill(int, int, int); -#define old_kill(x, y) __kill(x, y, 0) -#define old_killpg(x, y) __kill(-(x), y, 0) -#else -#define _NONSTD_SOURCE 1 -#define old_kill(x, y) kill(x, y) -#define old_killpg(x, y) killpg(x, y) -#endif +#include +#include #include #include "launchd_runtime_kill.h" -/* - * POSIX defines consistency over correctness, and consequently kill/killpg now - * returns EPERM instead of ESRCH. - * - * I've filed 5487498 to get a non-portable kill() variant, but for now, - * defining _NONSTD_SOURCE gets us the old behavior. - */ - int runtime_kill(pid_t pid, int sig) { - return old_kill(pid, sig); + /* + * POSIX defines consistency over correctness, and consequently + * kill/killpg now returns EPERM instead of ESRCH. + * + * I've filed 5487498 to get a non-portable kill(). + * We'll regretfully take advantage of implementation details for now. + */ + return syscall(SYS_kill, pid, sig, 0); } int runtime_killpg(pid_t pgrp, int sig) { - return old_killpg(pgrp, sig); + return runtime_kill(-pgrp, sig); } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20080502/0974dfa2/attachment-0001.html From source_changes at macosforge.org Fri May 2 16:19:25 2008 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Fri May 2 16:19:24 2008 Subject: [launchd-changes] [23618] trunk/launchd/src/launchd_core_logic.c Message-ID: <20080502231925.5C6E21627227@beta.macosforge.org> Revision: 23618 http://trac.macosforge.org/projects/launchd/changeset/23618 Author: zarzycki@apple.com Date: 2008-05-02 16:19:24 -0700 (Fri, 02 May 2008) Log Message: ----------- 10A52: Stuck at an empty desktop after changing homedirs Investigation: Accounting for transient processes Modified Paths: -------------- trunk/launchd/src/launchd_core_logic.c Modified: trunk/launchd/src/launchd_core_logic.c =================================================================== --- trunk/launchd/src/launchd_core_logic.c 2008-05-02 22:58:06 UTC (rev 23617) +++ trunk/launchd/src/launchd_core_logic.c 2008-05-02 23:19:24 UTC (rev 23618) @@ -324,8 +324,6 @@ /* static void jobmgr_log_error(jobmgr_t jm, int pri, const char *msg, ...) __attribute__((format(printf, 3, 4))); */ static void jobmgr_log_bug(jobmgr_t jm, unsigned int line); -#define DO_RUSAGE_SUMMATION 0 - #define AUTO_PICK_LEGACY_LABEL (const char *)(~0) struct job_s { @@ -343,9 +341,7 @@ SLIST_HEAD(, machservice) machservices; SLIST_HEAD(, semaphoreitem) semaphores; SLIST_HEAD(, waiting_for_removal) removal_watchers; -#if DO_RUSAGE_SUMMATION struct rusage ru; -#endif cpu_type_t *j_binpref; size_t j_binpref_cnt; mach_port_t j_port; @@ -921,7 +917,6 @@ ipc_close_all_with_job(j); -#if DO_RUSAGE_SUMMATION job_log(j, LOG_INFO, "Total rusage: utime %ld.%06u stime %ld.%06u maxrss %lu ixrss %lu idrss %lu isrss %lu minflt %lu majflt %lu nswap %lu inblock %lu oublock %lu msgsnd %lu msgrcv %lu nsignals %lu nvcsw %lu nivcsw %lu", j->ru.ru_utime.tv_sec, j->ru.ru_utime.tv_usec, j->ru.ru_stime.tv_sec, j->ru.ru_stime.tv_usec, @@ -930,7 +925,6 @@ j->ru.ru_nswap, j->ru.ru_inblock, j->ru.ru_oublock, j->ru.ru_msgsnd, j->ru.ru_msgrcv, j->ru.ru_nsignals, j->ru.ru_nvcsw, j->ru.ru_nivcsw); -#endif if (j->forced_peers_to_demand_mode) { job_set_global_on_demand(j, false); @@ -2393,7 +2387,6 @@ job_log(j, LOG_INFO, "Exited %lld.%06lld seconds after %s was sent", td_sec, td_usec, signal_to_C_name(SIGTERM)); } -#if DO_RUSAGE_SUMMATION timeradd(&ru.ru_utime, &j->ru.ru_utime, &j->ru.ru_utime); timeradd(&ru.ru_stime, &j->ru.ru_stime, &j->ru.ru_stime); j->ru.ru_maxrss += ru.ru_maxrss; @@ -2410,7 +2403,6 @@ j->ru.ru_nsignals += ru.ru_nsignals; j->ru.ru_nvcsw += ru.ru_nvcsw; j->ru.ru_nivcsw += ru.ru_nivcsw; -#endif if (WIFEXITED(status) && WEXITSTATUS(status) != 0) { job_log(j, LOG_WARNING, "Exited with exit code: %d", WEXITSTATUS(status)); @@ -3171,7 +3163,6 @@ { /* This function is all about 5201578 */ - const char *shell_env_var = getenv("SHELL"); const char *home_env_var = getenv("HOME"); const char *user_env_var = getenv("USER"); const char *logname_env_var = getenv("LOGNAME"); @@ -3183,7 +3174,7 @@ struct passwd *pwe; - if (!job_assumes(j, shell_env_var && home_env_var && user_env_var && logname_env_var + if (!job_assumes(j, home_env_var && user_env_var && logname_env_var && strcmp(user_env_var, logname_env_var) == 0)) { goto out_bad; } @@ -3208,10 +3199,6 @@ strlcpy(loginname, pwe->pw_name, sizeof(loginname)); strlcpy(homedir, pwe->pw_dir, sizeof(homedir)); - if (strcmp(shellpath, shell_env_var) != 0) { - job_log(j, LOG_ERR, "The %s environmental variable changed out from under us!", "SHELL"); - goto out_bad; - } if (strcmp(loginname, logname_env_var) != 0) { job_log(j, LOG_ERR, "The %s environmental variable changed out from under us!", "USER"); goto out_bad; @@ -3233,8 +3220,12 @@ return; out_bad: +#if 0 job_assumes(j, runtime_kill(getppid(), SIGTERM) != -1); _exit(EXIT_FAILURE); +#else + job_log(j, LOG_WARNING, "In a future build of the OS, this error will be fatal."); +#endif } void -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20080502/1b837e0c/attachment.html From source_changes at macosforge.org Fri May 2 16:19:42 2008 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Fri May 2 16:19:40 2008 Subject: [launchd-changes] [23619] tags/launchd-274/ Message-ID: <20080502231942.D0CE21627249@beta.macosforge.org> Revision: 23619 http://trac.macosforge.org/projects/launchd/changeset/23619 Author: zarzycki@apple.com Date: 2008-05-02 16:19:42 -0700 (Fri, 02 May 2008) Log Message: ----------- "Tagging launchd-274 from https://svn.macosforge.org/repository/launchd/trunk" Added Paths: ----------- tags/launchd-274/ Copied: tags/launchd-274 (from rev 23618, trunk) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20080502/4708d8bc/attachment.html From source_changes at macosforge.org Mon May 5 13:23:43 2008 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Mon May 5 13:23:41 2008 Subject: [launchd-changes] [23620] trunk/launchd/src/launchd_core_logic.c Message-ID: <20080505202343.47D331630F19@beta.macosforge.org> Revision: 23620 http://trac.macosforge.org/projects/launchd/changeset/23620 Author: zarzycki@apple.com Date: 2008-05-05 13:23:42 -0700 (Mon, 05 May 2008) Log Message: ----------- launchd fork/exec log message is incorrect Modified Paths: -------------- trunk/launchd/src/launchd_core_logic.c Modified: trunk/launchd/src/launchd_core_logic.c =================================================================== --- trunk/launchd/src/launchd_core_logic.c 2008-05-02 23:19:42 UTC (rev 23619) +++ trunk/launchd/src/launchd_core_logic.c 2008-05-05 20:23:42 UTC (rev 23620) @@ -475,7 +475,7 @@ static void job_callback_timer(job_t j, void *ident); static void job_callback_read(job_t j, int ident); static void job_log_stray_pg(job_t j); -static void job_log_chidren_without_exec(job_t j); +static void job_log_children_without_exec(job_t j); static job_t job_new_anonymous(jobmgr_t jm, pid_t anonpid) __attribute__((malloc, nonnull, warn_unused_result)); static job_t job_new(jobmgr_t jm, const char *label, const char *prog, const char *const *argv) __attribute__((malloc, nonnull(1,2), warn_unused_result)); static job_t job_new_via_mach_init(job_t j, const char *cmd, uid_t uid, bool ond) __attribute__((malloc, nonnull, warn_unused_result)); @@ -2564,7 +2564,7 @@ } void -job_log_chidren_without_exec(job_t j) +job_log_children_without_exec(job_t j) { /* ER: Add a KERN_PROC_PPID sysctl */ #ifdef KERN_PROC_PPID @@ -2599,7 +2599,7 @@ continue; } - job_log(j, LOG_APPLEONLY, "Performance and sanity: fork() without exec*(). Please switch to posix_spawn(). Child PID %u", + job_log(j, LOG_APPLEONLY, "Called *fork(). Please switch to posix_spawn*(), pthreads or launchd. Child PID %u", kp[i].kp_proc.p_pid); } @@ -2641,7 +2641,7 @@ if (fflags & NOTE_FORK) { job_log(j, LOG_DEBUG, "fork()ed%s", program_changed ? ". For this message only: We don't know whether this event happened before or after execve()." : ""); - job_log_chidren_without_exec(j); + job_log_children_without_exec(j); } if (fflags & NOTE_EXIT) { -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20080505/4a2ff104/attachment-0001.html From source_changes at macosforge.org Mon May 5 16:31:03 2008 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Mon May 5 16:31:03 2008 Subject: [launchd-changes] [23621] trunk/launchd/src/launchd_runtime.c Message-ID: <20080505233103.CF2E91631C0E@beta.macosforge.org> Revision: 23621 http://trac.macosforge.org/projects/launchd/changeset/23621 Author: zarzycki@apple.com Date: 2008-05-05 16:31:03 -0700 (Mon, 05 May 2008) Log Message: ----------- 10A43: NFS trying to connect to servers after the VPN is down Modified Paths: -------------- trunk/launchd/src/launchd_runtime.c Modified: trunk/launchd/src/launchd_runtime.c =================================================================== --- trunk/launchd/src/launchd_runtime.c 2008-05-05 20:23:42 UTC (rev 23620) +++ trunk/launchd/src/launchd_runtime.c 2008-05-05 23:31:03 UTC (rev 23621) @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -147,6 +148,7 @@ { mach_msg_size_t mxmsgsz; pthread_attr_t attr; + pid_t p = getpid(); launchd_assert((mainkq = kqueue()) != -1); @@ -175,6 +177,8 @@ pthread_attr_setstacksize(&attr, PTHREAD_STACK_MIN); launchd_assert(pthread_create(&demand_thread, &attr, mport_demand_loop, NULL) == 0); pthread_attr_destroy(&attr); + + launchd_assumes(sysctlbyname("vfs.generic.noremotehang", NULL, NULL, &p, sizeof(p)) != -1); } INTERNAL_ABI void @@ -731,6 +735,9 @@ launchd_assumes(sigprocmask(SIG_SETMASK, &oset, NULL) != -1); launchd_assumes(launchd_set_bport(MACH_PORT_NULL) == KERN_SUCCESS); } else { + pid_t p = -getpid(); + launchd_assumes(sysctlbyname("vfs.generic.noremotehang", NULL, NULL, &p, sizeof(p)) != -1); + launchd_assumes(sigprocmask(SIG_SETMASK, &emptyset, NULL) != -1); } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20080505/2da395ae/attachment.html From source_changes at macosforge.org Wed May 7 15:15:07 2008 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Wed May 7 15:15:05 2008 Subject: [launchd-changes] [23622] tags/launchd-275/ Message-ID: <20080507221507.6053A164CE11@beta.macosforge.org> Revision: 23622 http://trac.macosforge.org/projects/launchd/changeset/23622 Author: zarzycki@apple.com Date: 2008-05-07 15:15:06 -0700 (Wed, 07 May 2008) Log Message: ----------- "Tagging launchd-275 from https://svn.macosforge.org/repository/launchd/trunk" Added Paths: ----------- tags/launchd-275/ Copied: tags/launchd-275 (from rev 23621, trunk) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20080507/ab6e8dbd/attachment.html From source_changes at macosforge.org Fri May 9 13:05:28 2008 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Fri May 9 13:05:27 2008 Subject: [launchd-changes] [23623] trunk/launchd/src/libbootstrap.c Message-ID: <20080509200528.DAEC01661FB4@beta.macosforge.org> Revision: 23623 http://trac.macosforge.org/projects/launchd/changeset/23623 Author: zarzycki@apple.com Date: 2008-05-09 13:05:28 -0700 (Fri, 09 May 2008) Log Message: ----------- Drag and drop no longer works from Finder to TextEdit - problem in bootstrap_look_up2? Modified Paths: -------------- trunk/launchd/src/libbootstrap.c Modified: trunk/launchd/src/libbootstrap.c =================================================================== --- trunk/launchd/src/libbootstrap.c 2008-05-07 22:15:06 UTC (rev 23622) +++ trunk/launchd/src/libbootstrap.c 2008-05-09 20:05:28 UTC (rev 23623) @@ -173,11 +173,16 @@ static mach_port_t prev_bp; static mach_port_t prev_sp; static name_t prev_name; + bool per_pid_lookup = flags & BOOTSTRAP_PER_PID_SERVICE; kern_return_t kr = 0; mach_port_t puc; pthread_mutex_lock(&bslu2_lock); + if (per_pid_lookup) { + goto skip_cache; + } + if (prev_sp) { if ((bp == prev_bp) && (strncmp(prev_name, service_name, sizeof(name_t)) == 0) && (mach_port_mod_refs(mach_task_self(), prev_sp, MACH_PORT_RIGHT_SEND, 1) == 0)) { @@ -189,6 +194,7 @@ } } +skip_cache: if ((kr = vproc_mig_look_up2(bp, service_name, sp, target_pid, flags)) != VPROC_ERR_TRY_PER_USER) { goto out; } @@ -201,7 +207,8 @@ mach_port_deallocate(mach_task_self(), puc); out: - if (kr == 0 && prev_sp == 0 && mach_port_mod_refs(mach_task_self(), *sp, MACH_PORT_RIGHT_SEND, 1) == 0) { + if (!per_pid_lookup && kr == 0 && prev_sp == 0 + && mach_port_mod_refs(mach_task_self(), *sp, MACH_PORT_RIGHT_SEND, 1) == 0) { /* We're going to hold on to a send right as a MRU cache */ prev_bp = bp; prev_sp = *sp; -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20080509/a28ec947/attachment.html From source_changes at macosforge.org Fri May 9 13:10:10 2008 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Fri May 9 13:10:07 2008 Subject: [launchd-changes] [23624] trunk/launchd/src/libvproc.c Message-ID: <20080509201010.254861661FF9@beta.macosforge.org> Revision: 23624 http://trac.macosforge.org/projects/launchd/changeset/23624 Author: zarzycki@apple.com Date: 2008-05-09 13:10:09 -0700 (Fri, 09 May 2008) Log Message: ----------- Make vproc_transaction_{begin,end} available to command-line tools Modified Paths: -------------- trunk/launchd/src/libvproc.c Modified: trunk/launchd/src/libvproc.c =================================================================== --- trunk/launchd/src/libvproc.c 2008-05-09 20:05:28 UTC (rev 23623) +++ trunk/launchd/src/libvproc.c 2008-05-09 20:10:09 UTC (rev 23624) @@ -164,6 +164,10 @@ { typeof(vproc_shmem->vp_shmem_transaction_cnt) newval; + if (unlikely(vproc_shmem == NULL)) { + return; + } + newval = __sync_sub_and_fetch(&vproc_shmem->vp_shmem_transaction_cnt, 1); if (unlikely(newval < 0)) { -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20080509/2a953dd7/attachment-0001.html From source_changes at macosforge.org Fri May 9 13:11:16 2008 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Fri May 9 13:11:12 2008 Subject: [launchd-changes] [23625] tags/launchd-276/ Message-ID: <20080509201116.3410B1662017@beta.macosforge.org> Revision: 23625 http://trac.macosforge.org/projects/launchd/changeset/23625 Author: zarzycki@apple.com Date: 2008-05-09 13:11:15 -0700 (Fri, 09 May 2008) Log Message: ----------- "Tagging launchd-276 from https://svn.macosforge.org/repository/launchd/trunk" Added Paths: ----------- tags/launchd-276/ Copied: tags/launchd-276 (from rev 23624, trunk) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20080509/37a033e0/attachment.html From source_changes at macosforge.org Fri May 9 15:38:52 2008 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Fri May 9 15:38:51 2008 Subject: [launchd-changes] [23626] trunk/launchd/src/launchd_core_logic.c Message-ID: <20080509223852.454871662891@beta.macosforge.org> Revision: 23626 http://trac.macosforge.org/projects/launchd/changeset/23626 Author: zarzycki@apple.com Date: 2008-05-09 15:38:49 -0700 (Fri, 09 May 2008) Log Message: ----------- 10A37: launchd SIGKILL'ing after 2s Modified Paths: -------------- trunk/launchd/src/launchd_core_logic.c Modified: trunk/launchd/src/launchd_core_logic.c =================================================================== --- trunk/launchd/src/launchd_core_logic.c 2008-05-09 20:11:15 UTC (rev 23625) +++ trunk/launchd/src/launchd_core_logic.c 2008-05-09 22:38:49 UTC (rev 23626) @@ -99,8 +99,17 @@ #include "job_reply.h" #include "job_forward.h" +/* + * LAUNCHD_SAMPLE_TIMEOUT + * If the job hasn't exited in the given number of seconds after sending + * it a SIGTERM, start sampling it. + * LAUNCHD_DEFAULT_EXIT_TIMEOUT + * If the job hasn't exited in the given number of seconds after sending + * it a SIGTERM, SIGKILL it. Can be overriden in the job plist. + */ #define LAUNCHD_MIN_JOB_RUN_TIME 10 -#define LAUNCHD_DEFAULT_EXIT_TIMEOUT 2 +#define LAUNCHD_SAMPLE_TIMEOUT 2 +#define LAUNCHD_DEFAULT_EXIT_TIMEOUT 20 #define LAUNCHD_SIGKILL_TIMER 5 #define SHUTDOWN_LOG_DIR "/var/log/shutdown" @@ -413,12 +422,13 @@ internal_exc_handler:1, /* MachExceptionHandler == true */ stall_before_exec:1, /* a hack to support an option of spawn_via_launchd() */ only_once:1, /* man launchd.plist --> LaunchOnlyOnce. Note: 5465184 Rename this to "HopefullyNeverExits" */ - currently_ignored:1, /* Make job_ignore() / job_watch() work. If these calls were balanced, then this wouldn't be necessarily. */ + currently_ignored:1, /* Make job_ignore() / job_watch() work. If these calls were balanced, then this wouldn't be necessarily. */ forced_peers_to_demand_mode:1, /* A job that forced all other jobs to be temporarily launch-on-demand */ setnice:1, /* man launchd.plist --> Nice */ hopefully_exits_last:1, /* man launchd.plist --> HopefullyExitsLast */ removal_pending:1, /* a job was asked to be unloaded/removed while running, we'll remove it after it exits */ sent_sigkill:1, /* job_kill() was called */ + sampled:1, /* job_force_sampletool() was called (or is disabled) */ debug_before_kill:1, /* enter the kernel debugger before killing a job */ weird_bootstrap:1, /* a hack that launchd+launchctl use during jobmgr_t creation */ start_on_mount:1, /* man launchd.plist --> StartOnMount */ @@ -627,12 +637,27 @@ if (newval < 0) { job_kill(j); } else { + /* + * If sampling is enabled and SAMPLE_TIMEOUT is earlier than the job exit_timeout, + * then set a timer for SAMPLE_TIMEOUT seconds after killing + */ + unsigned int exit_timeout = j->exit_timeout; + bool do_sample = do_apple_internal_logging; + unsigned int timeout = exit_timeout; + + if (do_sample && (!exit_timeout || (LAUNCHD_SAMPLE_TIMEOUT < exit_timeout))) { + timeout = LAUNCHD_SAMPLE_TIMEOUT; + } + job_assumes(j, runtime_kill(j->p, SIGTERM) != -1); - if (j->exit_timeout) { + if (timeout) { + j->sampled = !do_sample; job_assumes(j, kevent_mod((uintptr_t)&j->exit_timeout, EVFILT_TIMER, - EV_ADD|EV_ONESHOT, NOTE_SECONDS, j->exit_timeout, j) != -1); - } else { + EV_ADD|EV_ONESHOT, NOTE_SECONDS, timeout, j) != -1); + } + + if (!exit_timeout) { job_log(j, LOG_DEBUG, "This job has an infinite exit timeout"); } @@ -2424,6 +2449,7 @@ } j->last_exit_status = status; j->sent_sigkill = false; + j->sampled = false; j->sent_kill_via_shmem = false; j->lastlookup = NULL; j->lastlookup_gennum = 0; @@ -2671,20 +2697,39 @@ j->start_pending = true; job_dispatch(j, false); } else if (&j->exit_timeout == ident) { + /* + * This block might be executed up to 3 times for a given (slow) job + * - once for the SAMPLE_TIMEOUT timer, at which point sampling is triggered + * - once for the exit_timeout timer, at which point: + * - sampling is performed if not triggered previously + * - SIGKILL is being sent to the job + * - once for the SIGKILL_TIMER timer, at which point we log an issue + * with the long SIGKILL + */ if (j->sent_sigkill) { uint64_t td = runtime_get_nanoseconds_since(j->sent_sigterm_time); td /= NSEC_PER_SEC; td -= j->exit_timeout; - job_log(j, LOG_ERR, "Did not die after sending SIGKILL %llu seconds ago...", td); + job_log(j, LOG_WARNING, "Did not die after sending SIGKILL %llu seconds ago...", td); + } else if (!j->sampled && (!j->exit_timeout || (LAUNCHD_SAMPLE_TIMEOUT < j->exit_timeout))) { + /* This should work even if the job changes its exit_timeout midstream */ + job_log(j, LOG_NOTICE, "Sampling timeout elapsed (%u seconds). Sampling...", LAUNCHD_SAMPLE_TIMEOUT); + if (j->exit_timeout) { + unsigned int ttk = (j->exit_timeout - LAUNCHD_SAMPLE_TIMEOUT); + job_assumes(j, kevent_mod((uintptr_t)&j->exit_timeout, EVFILT_TIMER, + EV_ADD|EV_ONESHOT, NOTE_SECONDS, ttk, j) != -1); + job_log(j, LOG_NOTICE, "Scheduled new exit timeout for %u seconds later", ttk); + } + job_force_sampletool(j); } else { - job_force_sampletool(j); + job_force_sampletool(j); /* no-op if already done in previous pass */ if (unlikely(j->debug_before_kill)) { - job_log(j, LOG_NOTICE, "Exit timeout elapsed. Entering the kernel debugger."); + job_log(j, LOG_NOTICE, "Exit timeout elapsed. Entering the kernel debugger"); job_assumes(j, host_reboot(mach_host_self(), HOST_REBOOT_DEBUGGER) == KERN_SUCCESS); } - job_log(j, LOG_WARNING, "Exit timeout elapsed (%u seconds). Killing.", j->exit_timeout); + job_log(j, LOG_WARNING, "Exit timeout elapsed (%u seconds). Killing", j->exit_timeout); job_kill(j); } } else { @@ -3394,7 +3439,7 @@ if (j->stdin_fd) { job_assumes(j, dup2(j->stdin_fd, STDIN_FILENO) != -1); } else { - job_setup_fd(j, STDIN_FILENO, j->stdinpath, O_RDONLY|O_CREAT); + job_setup_fd(j, STDIN_FILENO, j->stdinpath, O_RDONLY|O_CREAT); } job_setup_fd(j, STDOUT_FILENO, j->stdoutpath, O_WRONLY|O_CREAT|O_APPEND); job_setup_fd(j, STDERR_FILENO, j->stderrpath, O_WRONLY|O_CREAT|O_APPEND); @@ -5206,10 +5251,15 @@ int wstatus; pid_t sp; - if (!do_apple_internal_logging) { + if (j->sampled) { return; } - + j->sampled = true; + + if (!job_assumes(j, do_apple_internal_logging)) { + return; + } + if (!job_assumes(j, mkdir(SHUTDOWN_LOG_DIR, S_IRWXU) != -1 || errno == EEXIST)) { return; } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20080509/847214a6/attachment.html From source_changes at macosforge.org Tue May 13 09:40:58 2008 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Tue May 13 09:38:33 2008 Subject: [launchd-changes] [23627] tags/launchd-277/ Message-ID: <20080513164058.BC8AE1686401@beta.macosforge.org> Revision: 23627 http://trac.macosforge.org/projects/launchd/changeset/23627 Author: zarzycki@apple.com Date: 2008-05-13 09:40:57 -0700 (Tue, 13 May 2008) Log Message: ----------- "Tagging launchd-277 from https://svn.macosforge.org/repository/launchd/trunk" Added Paths: ----------- tags/launchd-277/ Copied: tags/launchd-277 (from rev 23626, trunk) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20080513/a454bb00/attachment-0001.html From source_changes at macosforge.org Fri May 16 16:42:50 2008 From: source_changes at macosforge.org (source_changes at macosforge.org) Date: Fri, 16 May 2008 16:42:50 -0700 (PDT) Subject: [launchd-changes] [23628] trunk/launchd/src/launchd_core_logic.c Message-ID: <20080516234250.6A5FE169F442@beta.macosforge.org> Revision: 23628 http://trac.macosforge.org/projects/launchd/changeset/23628 Author: zarzycki at apple.com Date: 2008-05-16 16:42:49 -0700 (Fri, 16 May 2008) Log Message: ----------- TENTATIVE: may need to pass a flag to 'sample' once 5921557 is fixed Modified Paths: -------------- trunk/launchd/src/launchd_core_logic.c Modified: trunk/launchd/src/launchd_core_logic.c =================================================================== --- trunk/launchd/src/launchd_core_logic.c 2008-05-13 16:40:57 UTC (rev 23627) +++ trunk/launchd/src/launchd_core_logic.c 2008-05-16 23:42:49 UTC (rev 23628) @@ -5244,7 +5244,7 @@ struct stat sb; char logfile[PATH_MAX]; char pidstr[100]; - char *sample_args[] = { "sample", pidstr, "1", "-mayDie", "-file", logfile, NULL }; + char *sample_args[] = { "sample", pidstr, "1", "-unsupportedShowArch", "-mayDie", "-file", logfile, NULL }; char *contents = NULL; int logfile_fd = -1; int console_fd = -1; -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20080516/6cbac2ae/attachment.htm From source_changes at macosforge.org Tue May 20 13:42:29 2008 From: source_changes at macosforge.org (source_changes at macosforge.org) Date: Tue, 20 May 2008 13:42:29 -0700 (PDT) Subject: [launchd-changes] [23629] tags/launchd-278/ Message-ID: <20080520204229.1845D16B781C@beta.macosforge.org> Revision: 23629 http://trac.macosforge.org/projects/launchd/changeset/23629 Author: zarzycki at apple.com Date: 2008-05-20 13:42:28 -0700 (Tue, 20 May 2008) Log Message: ----------- "Tagging launchd-278 from https://svn.macosforge.org/repository/launchd/trunk" Added Paths: ----------- tags/launchd-278/ Copied: tags/launchd-278 (from rev 23628, trunk) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20080520/4d8f01ce/attachment.htm From source_changes at macosforge.org Wed May 21 16:25:50 2008 From: source_changes at macosforge.org (source_changes at macosforge.org) Date: Wed, 21 May 2008 16:25:50 -0700 (PDT) Subject: [launchd-changes] [23630] trunk/launchd/src Message-ID: <20080521232550.7AB2F16BD45B@beta.macosforge.org> Revision: 23630 http://trac.macosforge.org/projects/launchd/changeset/23630 Author: zarzycki at apple.com Date: 2008-05-21 16:25:49 -0700 (Wed, 21 May 2008) Log Message: ----------- Misc. Modified Paths: -------------- trunk/launchd/src/launchd_core_logic.c trunk/launchd/src/reboot2.h Modified: trunk/launchd/src/launchd_core_logic.c =================================================================== --- trunk/launchd/src/launchd_core_logic.c 2008-05-20 20:42:28 UTC (rev 23629) +++ trunk/launchd/src/launchd_core_logic.c 2008-05-21 23:25:49 UTC (rev 23630) @@ -388,7 +388,7 @@ unsigned int timeout; unsigned int exit_timeout; int stdout_err_fd; - uint64_t sent_sigterm_time; + uint64_t sent_signal_time; uint64_t start_time; uint32_t min_run_time; uint32_t start_interval; @@ -632,7 +632,7 @@ } } - j->sent_sigterm_time = runtime_get_opaque_time(); + j->sent_signal_time = runtime_get_opaque_time(); if (newval < 0) { job_kill(j); @@ -662,7 +662,7 @@ } if (j->kill_via_shmem) { - snprintf(extralog, sizeof(extralog), ": %d remaining transactions", j->shmem->vp_shmem_transaction_cnt + 1); + snprintf(extralog, sizeof(extralog), ": %d remaining transactions", newval + 1); } else { extralog[0] = '\0'; } @@ -2403,13 +2403,13 @@ j->wait_reply_port = MACH_PORT_NULL; } - if (j->sent_sigterm_time) { - uint64_t td_sec, td_usec, td = runtime_get_nanoseconds_since(j->sent_sigterm_time); + if (j->sent_signal_time) { + uint64_t td_sec, td_usec, td = runtime_get_nanoseconds_since(j->sent_signal_time); td_sec = td / NSEC_PER_SEC; td_usec = (td % NSEC_PER_SEC) / NSEC_PER_USEC; - job_log(j, LOG_INFO, "Exited %lld.%06lld seconds after %s was sent", td_sec, td_usec, signal_to_C_name(SIGTERM)); + job_log(j, LOG_INFO, "Exited %llu.%06llu seconds after the first signal was sent", td_sec, td_usec); } timeradd(&ru.ru_utime, &j->ru.ru_utime, &j->ru.ru_utime); @@ -2448,6 +2448,7 @@ j->mgr->normal_active_cnt--; } j->last_exit_status = status; + j->sent_signal_time = 0; j->sent_sigkill = false; j->sampled = false; j->sent_kill_via_shmem = false; @@ -2707,7 +2708,7 @@ * with the long SIGKILL */ if (j->sent_sigkill) { - uint64_t td = runtime_get_nanoseconds_since(j->sent_sigterm_time); + uint64_t td = runtime_get_nanoseconds_since(j->sent_signal_time); td /= NSEC_PER_SEC; td -= j->exit_timeout; @@ -2889,8 +2890,6 @@ return; } - j->sent_sigterm_time = 0; - if (likely(!j->legacy_mach_job)) { sipc = (!SLIST_EMPTY(&j->sockets) || !SLIST_EMPTY(&j->machservices)); } @@ -5251,9 +5250,10 @@ int wstatus; pid_t sp; - if (j->sampled) { + if (j->sampled || j->per_user) { return; } + j->sampled = true; if (!job_assumes(j, do_apple_internal_logging)) { @@ -7039,12 +7039,17 @@ kern_return_t job_mig_set_service_policy(job_t j, pid_t target_pid, uint64_t flags, name_t target_service) { + struct ldcred *ldc = runtime_get_caller_creds(); job_t target_j; if (!launchd_assumes(j != NULL)) { return BOOTSTRAP_NO_MEMORY; } + if (unlikely(ldc->euid || ldc->uid)) { + return BOOTSTRAP_NOT_PRIVILEGED; + } + if (unlikely(!SLIST_EMPTY(&j->mspolicies))) { job_log(j, LOG_WARNING, "Jobs that have policies assigned to them may not set policies."); return BOOTSTRAP_NOT_PRIVILEGED; Modified: trunk/launchd/src/reboot2.h =================================================================== --- trunk/launchd/src/reboot2.h 2008-05-20 20:42:28 UTC (rev 23629) +++ trunk/launchd/src/reboot2.h 2008-05-21 23:25:49 UTC (rev 23630) @@ -26,6 +26,8 @@ __BEGIN_DECLS +#define RB2_FULLREBOOT 0x8000000000000000llu + /* Returns NULL on success. Not NULL on failure */ __attribute__((visibility("default"))) void *reboot2(uint64_t flags); -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20080521/197d379d/attachment.htm From source_changes at macosforge.org Wed May 21 17:27:39 2008 From: source_changes at macosforge.org (source_changes at macosforge.org) Date: Wed, 21 May 2008 17:27:39 -0700 (PDT) Subject: [launchd-changes] [23631] branches/SULeopard/launchd/src/launchd_core_logic.c Message-ID: <20080522002739.BA9C516BD834@beta.macosforge.org> Revision: 23631 http://trac.macosforge.org/projects/launchd/changeset/23631 Author: zarzycki at apple.com Date: 2008-05-21 17:27:39 -0700 (Wed, 21 May 2008) Log Message: ----------- embedded updates Modified Paths: -------------- branches/SULeopard/launchd/src/launchd_core_logic.c Modified: branches/SULeopard/launchd/src/launchd_core_logic.c =================================================================== --- branches/SULeopard/launchd/src/launchd_core_logic.c 2008-05-21 23:25:49 UTC (rev 23630) +++ branches/SULeopard/launchd/src/launchd_core_logic.c 2008-05-22 00:27:39 UTC (rev 23631) @@ -5246,6 +5246,10 @@ struct ldcred ldc; job_t js; +#if TARGET_OS_EMBEDDED + return BOOTSTRAP_NOT_PRIVILEGED; +#endif + if (!launchd_assumes(j != NULL)) { return BOOTSTRAP_NO_MEMORY; } @@ -5734,6 +5738,10 @@ struct ldcred ldc; job_t ji; +#if TARGET_OS_EMBEDDED + return BOOTSTRAP_NOT_PRIVILEGED; +#endif + if (!launchd_assumes(j != NULL)) { return BOOTSTRAP_NO_MEMORY; } @@ -6020,6 +6028,10 @@ jobmgr_t jm; job_t ji; +#if TARGET_OS_EMBEDDED + return BOOTSTRAP_NOT_PRIVILEGED; +#endif + if (!launchd_assumes(j != NULL)) { return BOOTSTRAP_NO_MEMORY; } @@ -6142,6 +6154,10 @@ struct ldcred ldc; jobmgr_t jmr = NULL; +#if TARGET_OS_EMBEDDED + return BOOTSTRAP_NOT_PRIVILEGED; +#endif + if (!launchd_assumes(j != NULL)) { return BOOTSTRAP_NO_MEMORY; } @@ -6318,6 +6334,10 @@ jobmgr_t jm; job_t ji; +#if TARGET_OS_EMBEDDED + return BOOTSTRAP_NOT_PRIVILEGED; +#endif + if (!launchd_assumes(j != NULL)) { return BOOTSTRAP_NO_MEMORY; } @@ -6608,12 +6628,19 @@ kern_return_t job_mig_set_service_policy(job_t j, pid_t target_pid, uint64_t flags, name_t target_service) { + struct ldcred ldc; job_t target_j; if (!launchd_assumes(j != NULL)) { return BOOTSTRAP_NO_MEMORY; } + runtime_get_caller_creds(&ldc); + + if (unlikely(ldc.uid || ldc.euid)) { + return BOOTSTRAP_NOT_PRIVILEGED; + } + if (!job_assumes(j, (target_j = jobmgr_find_by_pid(j->mgr, target_pid, true)) != NULL)) { return BOOTSTRAP_NO_MEMORY; } @@ -6642,6 +6669,10 @@ struct ldcred ldc; job_t jr; +#if TARGET_OS_EMBEDDED + return BOOTSTRAP_NOT_PRIVILEGED; +#endif + runtime_get_caller_creds(&ldc); if (!launchd_assumes(j != NULL)) { -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20080521/1cf6bd7c/attachment-0001.htm From source_changes at macosforge.org Wed May 21 17:28:44 2008 From: source_changes at macosforge.org (source_changes at macosforge.org) Date: Wed, 21 May 2008 17:28:44 -0700 (PDT) Subject: [launchd-changes] [23632] tags/launchd-258.15/ Message-ID: <20080522002844.E1F9016BD85F@beta.macosforge.org> Revision: 23632 http://trac.macosforge.org/projects/launchd/changeset/23632 Author: zarzycki at apple.com Date: 2008-05-21 17:28:44 -0700 (Wed, 21 May 2008) Log Message: ----------- "Tagging launchd-258.15 from https://svn.macosforge.org/repository/launchd/branches/SULeopard" Added Paths: ----------- tags/launchd-258.15/ Copied: tags/launchd-258.15 (from rev 23631, branches/SULeopard) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20080521/539766a0/attachment.htm From source_changes at macosforge.org Wed May 21 17:29:47 2008 From: source_changes at macosforge.org (source_changes at macosforge.org) Date: Wed, 21 May 2008 17:29:47 -0700 (PDT) Subject: [launchd-changes] [23633] branches/SULeopard/launchd/src/launchd_core_logic.c Message-ID: <20080522002947.5729616BD893@beta.macosforge.org> Revision: 23633 http://trac.macosforge.org/projects/launchd/changeset/23633 Author: zarzycki at apple.com Date: 2008-05-21 17:29:46 -0700 (Wed, 21 May 2008) Log Message: ----------- more embedded updates Modified Paths: -------------- branches/SULeopard/launchd/src/launchd_core_logic.c Modified: branches/SULeopard/launchd/src/launchd_core_logic.c =================================================================== --- branches/SULeopard/launchd/src/launchd_core_logic.c 2008-05-22 00:28:44 UTC (rev 23632) +++ branches/SULeopard/launchd/src/launchd_core_logic.c 2008-05-22 00:29:46 UTC (rev 23633) @@ -2612,6 +2612,11 @@ if (!j->legacy_mach_job) { sipc = (!SLIST_EMPTY(&j->sockets) || !SLIST_EMPTY(&j->machservices)); +#if TARGET_OS_EMBEDDED + if (j->username && strcmp(j->username, "mobile") == 0 && strncmp(j->label, "com.apple.", strlen("com.apple.")) != 0) { + sipc = false; + } +#endif } j->checkedin = false; -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20080521/bffb7ca8/attachment.htm From source_changes at macosforge.org Wed May 21 17:29:58 2008 From: source_changes at macosforge.org (source_changes at macosforge.org) Date: Wed, 21 May 2008 17:29:58 -0700 (PDT) Subject: [launchd-changes] [23634] tags/launchd-258.16/ Message-ID: <20080522002958.2439116BD8B2@beta.macosforge.org> Revision: 23634 http://trac.macosforge.org/projects/launchd/changeset/23634 Author: zarzycki at apple.com Date: 2008-05-21 17:29:57 -0700 (Wed, 21 May 2008) Log Message: ----------- "Tagging launchd-258.16 from https://svn.macosforge.org/repository/launchd/branches/SULeopard" Added Paths: ----------- tags/launchd-258.16/ Copied: tags/launchd-258.16 (from rev 23633, branches/SULeopard) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20080521/d4640af9/attachment.htm From source_changes at macosforge.org Thu May 22 09:05:49 2008 From: source_changes at macosforge.org (source_changes at macosforge.org) Date: Thu, 22 May 2008 09:05:49 -0700 (PDT) Subject: [launchd-changes] [23635] trunk/launchd/src/launchd_runtime.c Message-ID: <20080522160549.7CE7316C249B@beta.macosforge.org> Revision: 23635 http://trac.macosforge.org/projects/launchd/changeset/23635 Author: zarzycki at apple.com Date: 2008-05-22 09:05:37 -0700 (Thu, 22 May 2008) Log Message: ----------- launchd crashed, bringing down my session Modified Paths: -------------- trunk/launchd/src/launchd_runtime.c Modified: trunk/launchd/src/launchd_runtime.c =================================================================== --- trunk/launchd/src/launchd_runtime.c 2008-05-22 00:29:57 UTC (rev 23634) +++ trunk/launchd/src/launchd_runtime.c 2008-05-22 16:05:37 UTC (rev 23635) @@ -602,33 +602,35 @@ x_handle_kqueue(mach_port_t junk __attribute__((unused)), integer_t fd) { struct timespec ts = { 0, 0 }; - struct kevent kev[BULK_KEV_MAX]; + struct kevent *kevi, kev[BULK_KEV_MAX]; int i; bulk_kev = kev; if (launchd_assumes((bulk_kev_cnt = kevent(fd, NULL, 0, kev, BULK_KEV_MAX, &ts)) != -1)) { -#if 0 - Dl_info dli; - - if (launchd_assumes(malloc_size(kev.udata) || dladdr(kev.udata, &dli))) { -#endif for (i = 0; i < bulk_kev_cnt; i++) { log_kevent_struct(LOG_DEBUG, kev, i); } for (i = 0; i < bulk_kev_cnt; i++) { bulk_kev_i = i; - if (kev[i].filter) { - runtime_ktrace(RTKT_LAUNCHD_BSD_KEVENT|DBG_FUNC_START, kev[i].ident, kev[i].filter, kev[i].fflags); - (*((kq_callback *)kev[i].udata))(kev[i].udata, &kev[i]); + kevi = &kev[i]; + + if (kevi->filter) { +#if 1 + Dl_info dli; + + if (launchd_assumes(malloc_size(kevi->udata) || dladdr(kevi->udata, &dli))) { +#endif + runtime_ktrace(RTKT_LAUNCHD_BSD_KEVENT|DBG_FUNC_START, kevi->ident, kevi->filter, kevi->fflags); + (*((kq_callback *)kevi->udata))(kevi->udata, kevi); runtime_ktrace0(RTKT_LAUNCHD_BSD_KEVENT|DBG_FUNC_END); +#if 1 + } else { + log_kevent_struct(LOG_EMERG, kevi, 0); + } +#endif } } -#if 0 - } else { - log_kevent_struct(LOG_ERR, &kev, 0); - } -#endif } bulk_kev = NULL; -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20080522/5fafef89/attachment.htm From source_changes at macosforge.org Thu May 22 09:10:49 2008 From: source_changes at macosforge.org (source_changes at macosforge.org) Date: Thu, 22 May 2008 09:10:49 -0700 (PDT) Subject: [launchd-changes] [23636] tags/launchd-279/ Message-ID: <20080522161049.1DB4E16C24DF@beta.macosforge.org> Revision: 23636 http://trac.macosforge.org/projects/launchd/changeset/23636 Author: zarzycki at apple.com Date: 2008-05-22 09:10:43 -0700 (Thu, 22 May 2008) Log Message: ----------- "Tagging launchd-279 from https://svn.macosforge.org/repository/launchd/trunk" Added Paths: ----------- tags/launchd-279/ Copied: tags/launchd-279 (from rev 23635, trunk) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20080522/f26fadd9/attachment-0001.htm From source_changes at macosforge.org Wed May 28 10:21:26 2008 From: source_changes at macosforge.org (source_changes at macosforge.org) Date: Wed, 28 May 2008 10:21:26 -0700 (PDT) Subject: [launchd-changes] [23637] trunk/launchd/src/launchd_core_logic.c Message-ID: <20080528172126.583DD16E3304@beta.macosforge.org> Revision: 23637 http://trac.macosforge.org/projects/launchd/changeset/23637 Author: zarzycki at apple.com Date: 2008-05-28 10:21:25 -0700 (Wed, 28 May 2008) Log Message: ----------- sandbox_init: Could not set default launchd policy, err=1100 Modified Paths: -------------- trunk/launchd/src/launchd_core_logic.c Modified: trunk/launchd/src/launchd_core_logic.c =================================================================== --- trunk/launchd/src/launchd_core_logic.c 2008-05-22 16:10:43 UTC (rev 23636) +++ trunk/launchd/src/launchd_core_logic.c 2008-05-28 17:21:25 UTC (rev 23637) @@ -7046,7 +7046,7 @@ return BOOTSTRAP_NO_MEMORY; } - if (unlikely(ldc->euid || ldc->uid)) { + if (ldc->euid && (ldc->euid != getuid())) { return BOOTSTRAP_NOT_PRIVILEGED; } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20080528/9bead547/attachment.htm From source_changes at macosforge.org Wed May 28 10:28:23 2008 From: source_changes at macosforge.org (source_changes at macosforge.org) Date: Wed, 28 May 2008 10:28:23 -0700 (PDT) Subject: [launchd-changes] [23638] branches/SULeopard/launchd/src/launchd_core_logic.c Message-ID: <20080528172823.0947F16E338E@beta.macosforge.org> Revision: 23638 http://trac.macosforge.org/projects/launchd/changeset/23638 Author: zarzycki at apple.com Date: 2008-05-28 10:28:23 -0700 (Wed, 28 May 2008) Log Message: ----------- sandbox_init: Could not set default launchd policy, err=1100 Modified Paths: -------------- branches/SULeopard/launchd/src/launchd_core_logic.c Modified: branches/SULeopard/launchd/src/launchd_core_logic.c =================================================================== --- branches/SULeopard/launchd/src/launchd_core_logic.c 2008-05-28 17:21:25 UTC (rev 23637) +++ branches/SULeopard/launchd/src/launchd_core_logic.c 2008-05-28 17:28:23 UTC (rev 23638) @@ -6642,7 +6642,11 @@ runtime_get_caller_creds(&ldc); - if (unlikely(ldc.uid || ldc.euid)) { +#if TARGET_OS_EMBEDDED + if (ldc.euid) { +#else + if (ldc.euid && (ldc.euid != getuid())) { +#endif return BOOTSTRAP_NOT_PRIVILEGED; } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20080528/956a26b3/attachment.htm From source_changes at macosforge.org Wed May 28 13:33:09 2008 From: source_changes at macosforge.org (source_changes at macosforge.org) Date: Wed, 28 May 2008 13:33:09 -0700 (PDT) Subject: [launchd-changes] [23639] tags/launchd-280/ Message-ID: <20080528203309.7D9EE16E4582@beta.macosforge.org> Revision: 23639 http://trac.macosforge.org/projects/launchd/changeset/23639 Author: zarzycki at apple.com Date: 2008-05-28 13:33:08 -0700 (Wed, 28 May 2008) Log Message: ----------- "Tagging launchd-280 from https://svn.macosforge.org/repository/launchd/trunk" Added Paths: ----------- tags/launchd-280/ Copied: tags/launchd-280 (from rev 23638, trunk) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20080528/30902bc3/attachment.htm