Projects
Browse Source     Search     Timeline     Wiki

Changeset 23258

Show
Ignore:
Timestamp:
05/22/07 10:05:17 (19 months ago)
Author:
zarzycki@…
Message:

Security checks.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/launchd/src/launchd_core_logic.c

    r23255 r23258  
    45884588        size_t data_offset = 0; 
    45894589        size_t packed_size; 
     4590        struct ldcred ldc; 
     4591 
     4592        runtime_get_caller_creds(&ldc); 
    45904593 
    45914594        if (!launchd_assumes(j != NULL)) { 
    45924595                return BOOTSTRAP_NO_MEMORY; 
     4596        } 
     4597 
     4598        if (inkey && ldc.euid && ldc.euid != getuid()) { 
     4599                return BOOTSTRAP_NOT_PRIVILEGED; 
    45934600        } 
    45944601 
     
    46744681        const char *action; 
    46754682        kern_return_t kr = 0; 
     4683        struct ldcred ldc; 
    46764684        int oldmask; 
     4685 
     4686        runtime_get_caller_creds(&ldc); 
    46774687 
    46784688        if (!launchd_assumes(j != NULL)) { 
    46794689                return BOOTSTRAP_NO_MEMORY; 
     4690        } 
     4691 
     4692        if (inkey && ldc.euid && ldc.euid != getuid()) { 
     4693                return BOOTSTRAP_NOT_PRIVILEGED; 
    46804694        } 
    46814695