Changeset 441:3748177846de in roaraudio


Ignore:
Timestamp:
08/11/08 18:24:14 (16 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

we need to give getsockopt() a pointe rto the length, not the langth itself

File:
1 edited

Legend:

Unmodified
Added
Removed
  • roard/req.c

    r437 r441  
    1414#ifdef SO_PEERCRED 
    1515 struct ucred cred; 
     16 socklen_t cred_len = sizeof(cred); 
    1617#endif 
    1718 
     
    2324 if ( mes->data[0] == 1 ) { 
    2425#ifdef SO_PEERCRED 
    25   if (getsockopt(c->fh, SOL_SOCKET, SO_PEERCRED, &cred, (socklen_t) sizeof(struct ucred)) != -1) { 
     26  if (getsockopt(c->fh, SOL_SOCKET, SO_PEERCRED, &cred, &cred_len) != -1) { 
    2627   c->pid = cred.pid; 
    2728   c->uid = cred.uid; 
    2829   c->gid = cred.gid; 
     30  } else { 
     31   ROAR_DBG("req_on_identify(): Can't get creds via SO_PEERCRED: %s", strerror(errno)); 
    2932  } 
    3033#endif 
Note: See TracChangeset for help on using the changeset viewer.