Changeset 23487
- Timestamp:
- 2008-01-18 13:24:30 (9 months ago)
- Location:
- branches/SULeopard/launchd/src
- Files:
-
- 2 modified
-
launchd_core_logic.c (modified) (5 diffs)
-
liblaunch_public.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/SULeopard/launchd/src/launchd_core_logic.c
r23485 r23487 362 362 wait4pipe_eof:1, sent_sigkill:1, debug_before_kill:1, weird_bootstrap:1, start_on_mount:1, 363 363 per_user:1, hopefully_exits_first:1, deny_unknown_mslookups:1, unload_at_mig_return:1, abandon_pg:1, 364 poll_for_vfs_changes:1, internal_exc_handler:1, can_kickstart:1;364 poll_for_vfs_changes:1, internal_exc_handler:1, deny_job_creation:1; 365 365 const char label[0]; 366 366 }; … … 1576 1576 1577 1577 switch (key[0]) { 1578 case ' c':1579 case ' C':1580 if (strcasecmp(key, LAUNCH_JOBPOLICY_ CANKICKSTARTOTHERJOBS) == 0) {1581 j-> can_kickstart= launch_data_get_bool(obj);1578 case 'd': 1579 case 'D': 1580 if (strcasecmp(key, LAUNCH_JOBPOLICY_DENYCREATINGOTHERJOBS) == 0) { 1581 j->deny_job_creation = launch_data_get_bool(obj); 1582 1582 found_key = true; 1583 1583 } … … 5141 5141 } 5142 5142 5143 if (unlikely(j->deny_job_creation)) { 5144 return BOOTSTRAP_NOT_PRIVILEGED; 5145 } 5146 5143 5147 runtime_get_caller_creds(&ldc); 5144 5148 … … 6425 6429 } 6426 6430 6427 runtime_get_caller_creds(&ldc);6428 6429 if (!j->can_kickstart || (ldc.euid != 0 && ldc.euid != geteuid())) {6430 return BOOTSTRAP_NOT_PRIVILEGED;6431 }6432 6433 6431 if (unlikely(!(otherj = job_find(targetlabel)))) { 6434 6432 return BOOTSTRAP_UNKNOWN_SERVICE; 6433 } 6434 6435 runtime_get_caller_creds(&ldc); 6436 6437 if (ldc.euid != 0 && ldc.euid != geteuid() 6438 #if TARGET_OS_EMBEDDED 6439 && j->username && otherj->username 6440 && strcmp(j->username, otherj->username) != 0 6441 #endif 6442 ) { 6443 return BOOTSTRAP_NOT_PRIVILEGED; 6435 6444 } 6436 6445 … … 6521 6530 if (!launchd_assumes(j != NULL)) { 6522 6531 return BOOTSTRAP_NO_MEMORY; 6532 } 6533 6534 if (unlikely(j->deny_job_creation)) { 6535 return BOOTSTRAP_NOT_PRIVILEGED; 6523 6536 } 6524 6537 -
branches/SULeopard/launchd/src/liblaunch_public.h
r23485 r23487 102 102 #define LAUNCH_JOBKEY_POLICIES "Policies" 103 103 104 #define LAUNCH_JOBPOLICY_ CANKICKSTARTOTHERJOBS "CanKickStartOtherJobs"104 #define LAUNCH_JOBPOLICY_DENYCREATINGOTHERJOBS "DenyCreatingOtherJobs" 105 105 106 106 #define LAUNCH_JOBINETDCOMPATIBILITY_WAIT "Wait"

