Changeset 2757:c5621a2329a7 in roaraudio


Ignore:
Timestamp:
09/22/09 23:55:45 (15 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

early lookup of UID

File:
1 edited

Legend:

Unmodified
Added
Removed
  • roard/roard.c

    r2756 r2757  
    15111511#endif 
    15121512 
     1513#if defined(ROAR_HAVE_SETUID) && defined(ROAR_HAVE_IO_POSIX) 
     1514 // early test for UID as we need this for the pidfile and the setuid() 
     1515 if ( sock_user != NULL ) { 
     1516  if ( (pwd = getpwnam(sock_user)) == NULL ) { 
     1517   ROAR_ERR("Can not get UID for user %s: %s", sock_user, strerror(errno)); 
     1518   return 1; 
     1519  } 
     1520 } 
     1521#endif 
     1522 
    15131523#ifdef SUPPORT_PIDFILE 
    15141524 if ( pidfile != NULL ) { 
     
    15411551   return 1; 
    15421552  } 
    1543   if ( (pwd = getpwnam(sock_user)) == NULL ) { 
    1544    ROAR_ERR("Can not get UID for user %s: %s", sock_user, strerror(errno)); 
    1545    return 1; 
    1546   } 
    15471553  if ( !pwd || setuid(pwd->pw_uid) == -1 ) { 
    15481554   ROAR_ERR("Can not set UserID: %s", strerror(errno)); 
Note: See TracChangeset for help on using the changeset viewer.