XRootD
XrdOfsTPCAllow Class Reference
+ Collaboration diagram for XrdOfsTPCAllow:

Public Member Functions

 XrdOfsTPCAllow (char *vDN, char *vGN, char *vHN, char *vVO, XrdOfsTPCAllow *Prev)
 
 ~XrdOfsTPCAllow ()
 
int Match (const XrdSecEntity *Who, const char *Host)
 

Public Attributes

XrdOfsTPCAllowNext
 
char * theDN
 
char * theGN
 
XrdOucNListtheHN
 
char * theVO
 

Detailed Description

Definition at line 97 of file XrdOfsTPC.cc.

Constructor & Destructor Documentation

◆ XrdOfsTPCAllow()

XrdOfsTPCAllow::XrdOfsTPCAllow ( char *  vDN,
char *  vGN,
char *  vHN,
char *  vVO,
XrdOfsTPCAllow Prev 
)
inline

Definition at line 109 of file XrdOfsTPC.cc.

111  : Next(Prev), theDN(vDN), theGN(vGN), theVO(vVO)
112  {if (vHN) theHN = new XrdOucNList(vHN);
113  else theHN = 0;
114  }
XrdOucNList * theHN
Definition: XrdOfsTPC.cc:104
XrdOfsTPCAllow * Next
Definition: XrdOfsTPC.cc:101

◆ ~XrdOfsTPCAllow()

XrdOfsTPCAllow::~XrdOfsTPCAllow ( )
inline

Definition at line 115 of file XrdOfsTPC.cc.

115 {if (theHN) delete theHN;}

Member Function Documentation

◆ Match()

int XrdOfsTPCAllow::Match ( const XrdSecEntity Who,
const char *  Host 
)

Definition at line 122 of file XrdOfsTPC.cc.

123 {
124 // Host name comparisons should be case insensitive. However, DN's and VO's
125 // do take case into account.
126 //
127  if (theHN && (!Host || !(theHN->NameKO(Host )))) return 0;
128  if (theDN && (!(Who->name) || strcmp(theDN, Who->name))) return 0;
129  if (theVO && (!(Who->vorg) || strcmp(theDN, Who->vorg))) return 0;
130  if (!theGN) return 1;
131  if (Who->grps)
132  {char gBuff[1028], Group[64];
133  strlcpy(gBuff+1, Who->grps, sizeof(gBuff)-1); *gBuff = ' ';
134  strlcpy(Group+1, theGN, sizeof(Group)-1); *Group = ' ';
135  return strstr(gBuff, Group) != 0;
136  } else return 0;
137  return 1;
138 }
size_t strlcpy(char *dst, const char *src, size_t sz)
int NameKO(const char *pd, const int pl)
Definition: XrdOucNList.cc:64
char * vorg
Entity's virtual organization(s)
Definition: XrdSecEntity.hh:71
char * grps
Entity's group name(s)
Definition: XrdSecEntity.hh:73
char * name
Entity's name.
Definition: XrdSecEntity.hh:69

References Group, XrdSecEntity::grps, XrdSecEntity::name, strlcpy(), and XrdSecEntity::vorg.

Referenced by XrdOfsTPC::Authorize().

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

Member Data Documentation

◆ Next

XrdOfsTPCAllow* XrdOfsTPCAllow::Next

Definition at line 101 of file XrdOfsTPC.cc.

Referenced by XrdOfsTPC::Authorize().

◆ theDN

char* XrdOfsTPCAllow::theDN

Definition at line 102 of file XrdOfsTPC.cc.

◆ theGN

char* XrdOfsTPCAllow::theGN

Definition at line 103 of file XrdOfsTPC.cc.

◆ theHN

XrdOucNList* XrdOfsTPCAllow::theHN

Definition at line 104 of file XrdOfsTPC.cc.

◆ theVO

char* XrdOfsTPCAllow::theVO

Definition at line 105 of file XrdOfsTPC.cc.


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