Changeset 23601
- Timestamp:
- 2008-04-21 13:33:29 (4 months ago)
- Location:
- trunk/launchd/src
- Files:
-
- 2 modified
-
launchd_core_logic.c (modified) (1 diff)
-
libbootstrap.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/launchd/src/launchd_core_logic.c
r23600 r23601 5651 5651 job_log(j, LOG_DEBUG, "Server create attempt: %s", server_cmd); 5652 5652 5653 #define LET_MERE_MORTALS_ADD_SERVERS_TO_PID15654 /* XXX - This code should go away once the per session launchd is integrated with the rest of the system */5655 #ifdef LET_MERE_MORTALS_ADD_SERVERS_TO_PID15656 5653 if (pid1_magic) { 5657 if (unlikely(ldc->euid && server_uid && (ldc->euid != server_uid))) { 5658 job_log(j, LOG_WARNING, "Server create: \"%s\": Will run as UID %d, not UID %d as they told us to", 5659 server_cmd, ldc->euid, server_uid); 5660 server_uid = ldc->euid; 5661 } 5662 } else 5663 #endif 5664 if (getuid()) { 5654 if (ldc->euid || ldc->uid) { 5655 job_log(j, LOG_WARNING, "Server create attempt moved to per-user launchd: %s", server_cmd); 5656 return VPROC_ERR_TRY_PER_USER; 5657 } 5658 } else { 5665 5659 if (unlikely(server_uid != getuid())) { 5666 5660 job_log(j, LOG_WARNING, "Server create: \"%s\": As UID %d, we will not be able to switch to UID %d", -
trunk/launchd/src/libbootstrap.c
r23539 r23601 38 38 bootstrap_create_server(mach_port_t bp, cmd_t server_cmd, uid_t server_uid, boolean_t on_demand, mach_port_t *server_port) 39 39 { 40 return vproc_mig_create_server(bp, server_cmd, server_uid, on_demand, server_port); 40 kern_return_t kr; 41 42 kr = vproc_mig_create_server(bp, server_cmd, server_uid, on_demand, server_port); 43 44 if (kr == VPROC_ERR_TRY_PER_USER) { 45 mach_port_t puc; 46 47 if (vproc_mig_lookup_per_user_context(bp, 0, &puc) == 0) { 48 kr = vproc_mig_create_server(puc, server_cmd, server_uid, on_demand, server_port); 49 mach_port_deallocate(mach_task_self(), puc); 50 } 51 } 52 53 return kr; 41 54 } 42 55

