43 int XrdAccEntity::accSig = 0;
54 XrdAccEntity::XrdAccEntity(
const XrdSecEntity *secP,
bool &aOK)
66 if (secP->
vorg) {vorgInfo = strdup(secP->
vorg); want++;}
68 if (secP->
role) {roleInfo = strdup(secP->
role); want++;}
70 if (secP->
grps) {grpsInfo = strdup(secP->
grps); want++;}
81 if (OneOrZero(vorgInfo, attrInfo.vorg) && OneOrZero(roleInfo, attrInfo.role))
85 while((attrInfo.grup = grpsLine.GetToken()))
86 attrVec.push_back(attrInfo);
88 if (attrVec.size() == 0) attrVec.push_back(attrInfo);
95 if (vorgInfo) vorgLine.GetLine();
99 if (roleInfo) roleLine.GetLine();
103 if (grpsInfo) grpsLine.GetLine();
108 if (vorgInfo && setAttr(vorgLine, attrInfo.vorg)) have++;
109 if (roleInfo && setAttr(roleLine, attrInfo.role)) have++;
110 if (grpsInfo && setAttr(grpsLine, attrInfo.grup)) have++;
111 if (want != have)
break;
112 attrVec.push_back(attrInfo);
117 if (have) aOK =
false;
132 if ((seP = secP->
eaAPI->
Get(&accSig)))
150 snprintf(eBuff,
sizeof(eBuff),
"missing attrs in col %d for",
151 static_cast<int>(aeP->attrVec.size()));
152 eDest->
Emsg(
"Entity",
"Unable to validate entity;", eBuff,
163 bool XrdAccEntity::OneOrZero(
char *src,
const char *&dest)
175 while(*src ==
' ') src++;
177 while(*src && *src !=
' ') src++;
179 while(*src ==
' ') src++;
180 if (*src)
return false;
181 if (*sP) {dest = sP; *eP = 0;}
197 if (!secP->
eaAPI->
Add(*
this))
delete this;
207 if (!attr || !dest || strcmp(dest, attr)) dest = attr;
static XrdSysError eDest(0,"crypto_")
static void setError(XrdSysError *errP)
void PutEntity(const XrdSecEntity *secP)
static XrdAccEntity * GetEntity(const XrdSecEntity *secP, bool &isNew)
char * GetToken(char **rest=0, int lowcase=0)
bool Add(XrdSecAttr &attr)
XrdSecAttr * Get(const void *sigkey)
char * vorg
Entity's virtual organization(s)
XrdSecEntityAttr * eaAPI
non-const API to attributes
const char * tident
Trace identifier always preset.
char * grps
Entity's group name(s)
char * role
Entity's role(s)
int Emsg(const char *esfx, int ecode, const char *text1, const char *text2=0)