Print

Print


`XrdSecsssID::genID(int)` constructs an `XrdSecEntity` object:

```
   myID.name = (Secure || XrdOucUtils:: UserName(geteuid(), pBuff, pgSz))
             ? (char *)"nobody"  : pBuff;
   myID.grps = (Secure || XrdOucUtils::GroupName(getegid(), gBuff, pgSz))
             ? (char *)"nogroup" : gBuff;
```

`XrdOucUtils:: UserName` returns 0 on success, however `XrdOucUtils::GroupName` returns the length of the group name.  This means on group name of length 0 ( a 'failure') the un-initialized `gBuff` will be saved in `myID.grps`.  To avoid changing the behavior of `XrdOucutils::GroupName` solution is:

```
   myID.name = (Secure || XrdOucUtils:: UserName(geteuid(), pBuff, pgSz))
             ? (char *)"nobody"  : pBuff;
   myID.grps = (Secure || XrdOucUtils::GroupName(getegid(), gBuff, pgSz) == 0)
             ? (char *)"nogroup" : gBuff;
```

---
Reply to this email directly or view it on GitHub:
https://github.com/xrootd/xrootd/issues/53

########################################################################
Use REPLY-ALL to reply to list

To unsubscribe from the XROOTD-DEV list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=XROOTD-DEV&A=1