XRootD
Loading...
Searching...
No Matches
XrdAccEntity Class Reference

#include <XrdAccEntity.hh>

+ Inheritance diagram for XrdAccEntity:
+ Collaboration diagram for XrdAccEntity:

Public Member Functions

bool Next (int &seq, XrdAccEntityInfo &info)
 
void PutEntity (const XrdSecEntity *secP)
 
- Public Member Functions inherited from XrdSecAttr
 XrdSecAttr (const void *dSig)
 
virtual void Delete ()
 Delete this object (may be over-ridden for custom action).
 

Static Public Member Functions

static XrdAccEntityGetEntity (const XrdSecEntity *secP, bool &isNew)
 
static void setError (XrdSysError *errP)
 

Additional Inherited Members

- Protected Member Functions inherited from XrdSecAttr
virtual ~XrdSecAttr ()
 Destructor (always externally done via Delete() method).
 

Detailed Description

Definition at line 64 of file XrdAccEntity.hh.

Member Function Documentation

◆ GetEntity()

XrdAccEntity * XrdAccEntity::GetEntity ( const XrdSecEntity secP,
bool &  isNew 
)
static

Definition at line 124 of file XrdAccEntity.cc.

125{
126 XrdAccEntity *aeP;
127 XrdSecAttr *seP;
128 bool aOK;
129
130// If we already compiled the identity informaion, reuse it.
131//
132 if ((seP = secP->eaAPI->Get(&accSig)))
133 {isNew = false;
134 return static_cast<XrdAccEntity *>(seP);
135 }
136
137// At this point we muxt create a new entity for authorization purposes and
138// return it if all went well. We do not attach it to its SecEntity object as
139// this will be done by the AccEntityInit object upon deletion to avoid
140// race conditions and memory leaks. This allows for parallel processing.
141//
142 isNew = true;
143 aeP = new XrdAccEntity(secP, aOK);
144 if (aOK) return aeP;
145
146// Produce message indicating why we failed (there is only one possible reason)
147//
148 if (eDest)
149 {char eBuff[128];
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,
153 (secP->tident ? secP->tident : "???"));
154 }
155 delete aeP;
156 return 0;
157}
static XrdSysError eDest(0,"crypto_")
XrdSecAttr * Get(const void *sigkey)
XrdSecEntityAttr * eaAPI
non-const API to attributes
const char * tident
Trace identifier always preset.
int Emsg(const char *esfx, int ecode, const char *text1, const char *text2=0)

References XrdSecEntity::eaAPI, eDest, XrdSysError::Emsg(), XrdSecEntityAttr::Get(), and XrdSecEntity::tident.

Referenced by XrdAccEntityInit::XrdAccEntityInit().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Next()

bool XrdAccEntity::Next ( int &  seq,
XrdAccEntityInfo info 
)
inline

Definition at line 71 of file XrdAccEntity.hh.

72 {if (int(attrVec.size()) <= seq) return false;
73 EntityAttr *aP = &attrVec[seq++];
74 info.vorg = aP->vorg;
75 info.role = aP->role;
76 info.grup = aP->grup;
77 return true;
78 }
const char * vorg
const char * role
const char * grup

References XrdAccEntityInfo::grup, XrdAccEntityInfo::role, and XrdAccEntityInfo::vorg.

Referenced by XrdAccAccess::Access().

+ Here is the caller graph for this function:

◆ PutEntity()

void XrdAccEntity::PutEntity ( const XrdSecEntity secP)

Definition at line 190 of file XrdAccEntity.cc.

191{
192
193// Add this object to the indicated SecEntity object. There may be one there
194// already if some other thread beat us to the punch (unlike). If there is
195// we simply delete ourselves to avoid a memory leak.
196//
197 if (!secP->eaAPI->Add(*this)) delete this;
198}
bool Add(XrdSecAttr &attr)

References XrdSecEntityAttr::Add(), and XrdSecEntity::eaAPI.

Referenced by XrdAccEntityInit::~XrdAccEntityInit().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setError()

void XrdAccEntity::setError ( XrdSysError errP)
static

Definition at line 215 of file XrdAccEntity.cc.

215{eDest = erp;}

References eDest.

Referenced by XrdAccDefaultAuthorizeObject().

+ Here is the caller graph for this function:

The documentation for this class was generated from the following files: