56 {bL += strlen(key) + strlen(val) + 8;
69 copyAttrs() : bP(0), bL(0), calcSz(false) {}
78char *XrdSecsssEnt::myHostName = 0;
79int XrdSecsssEnt::myHostNLen = 0;
90 if (
conTrack) Contacts.insert(hostID);
120 if (!
eData && !Serialize())
return 0;
126 if (dataOpts &
addCreds) cpyLen += credLen;
127 }
else cpyLen =
iLen;
132 n = strlen(hostIP) + 4;
133 if (hostIP) totLen += n;
134 totLen += myHostNLen;
138 if (!(dP = (
char *)malloc(totLen)))
return 0;
151 {memcpy(bP, myHostName, myHostNLen); bP += myHostNLen;}
155 memcpy(bP,
eData, cpyLen);
166bool XrdSecsssEnt::Serialize()
171 bool incCreds =
false;
175 if (!eP)
return false;
186 + (eP->
vorg ? strlen(eP->
vorg) + 4 : 0)
187 + (eP->
role ? strlen(eP->
role) + 4 : 0)
188 + (eP->
grps ? strlen(eP->
grps) + 4 : 0)
189 + (eP->
caps ? strlen(eP->
caps) + 4 : 0)
198 if (!rBuff[0]) rBuff[0] =
'\xff';
207 theAttr.calcSz =
true;
209 theAttr.calcSz =
false;
225 if (*(eP->
prot) && strcmp(
"sss", eP->
prot))
227 tLen += strlen(uName) + 4;
230 tLen += strlen(gName) + 4;
321 {
if (myHostName) free(myHostName);
322 myHostName = bP = (
char *)malloc(n+4);
static const int XrdSecsssRR_Data_HdrLen
static int Pack(struct iovec **, const char *, unsigned short &buff)
static int UserName(uid_t uID, char *uName, int uNsz)
static int GroupName(gid_t gID, char *gName, int gNsz)
@ Stop
Stop the iteration.
@ Next
Proceed to the next key-value pair.
virtual Action Attr(const char *key, const char *val)=0
void List(XrdSecEntityAttrCB &attrCB)
char * vorg
Entity's virtual organization(s)
int credslen
Length of the 'creds' data.
XrdSecEntityAttr * eaAPI
non-const API to attributes
const char * tident
Trace identifier always preset.
char prot[XrdSecPROTOIDSIZE]
Auth protocol used (e.g. krb5)
char * caps
Entity's capabilities.
char * creds
Raw entity credentials or cert.
gid_t gid
Unix gid or 0 if none.
char * grps
Entity's group name(s)
uid_t uid
Unix uid or 0 if none.
char * name
Entity's name.
char * role
Entity's role(s)
char * endorsements
Protocol specific endorsements.
virtual void Cleanup(const std::set< std::string > &Contacts, const XrdSecEntity &Entity)=0
void Delete()
Delete this entity object.
static void setHostName(const char *hnP)
static const int v2Client
Data for a v2 client wanted.
void AddContact(const std::string &hostID)
static const int addCreds
Add v2 data plus creds.
int RR_Data(char *&dP, const char *hostIP, int dataOpts)
static void genKey(char *Buff, int blen)
static const char theHost
static const char theUser
static const char theAKey
static const char theCaps
static const char theAuth
static const char theRole
static const char theName
static const char theGrps
static const char theRand
static const char theEndo
static const char theAVal
static const char theVorg
static const char theGrup
static const char theCred