Changeset 2584:f33bdd5d299d in roaraudio


Ignore:
Timestamp:
09/06/09 16:15:35 (15 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

small fix: we should look UID/GID up in case we are going to use them

File:
1 edited

Legend:

Unmodified
Added
Removed
  • roard/roard.c

    r2549 r2584  
    13821382#ifdef ROAR_HAVE_SETGID 
    13831383 if ( setids & R_SETGID ) { 
     1384  if ( (grp = getgrnam(sock_grp)) == NULL ) { 
     1385   ROAR_ERR("Can not get GID for group %s: %s", sock_grp, strerror(errno)); 
     1386   return 1; 
     1387  } 
    13841388  if ( setgroups(0, (const gid_t *) NULL) == -1 ) { 
    13851389   ROAR_ERR("Can not clear supplementary group IDs: %s", strerror(errno)); 
     
    14501454#ifdef ROAR_HAVE_SETUID 
    14511455 if ( setids & R_SETUID ) { 
     1456  if ( (pwd = getpwnam(sock_user)) == NULL ) { 
     1457   ROAR_ERR("Can not get UID for user %s: %s", sock_user, strerror(errno)); 
     1458   return 1; 
     1459  } 
    14521460  if ( !pwd || setuid(pwd->pw_uid) == -1 ) { 
    14531461   ROAR_ERR("Can not set UserID: %s", strerror(errno)); 
Note: See TracChangeset for help on using the changeset viewer.