XRootD
XrdAccAccess.cc File Reference
#include <cctype>
#include <cstdio>
#include <ctime>
#include <sys/param.h>
#include "XrdVersion.hh"
#include "XrdAcc/XrdAccAccess.hh"
#include "XrdAcc/XrdAccEntity.hh"
#include "XrdAcc/XrdAccCapability.hh"
#include "XrdAcc/XrdAccConfig.hh"
#include "XrdAcc/XrdAccGroups.hh"
#include "XrdNet/XrdNetAddrInfo.hh"
#include "XrdOuc/XrdOucUtils.hh"
#include "XrdSec/XrdSecEntityAttr.hh"
#include "XrdSys/XrdSysPlugin.hh"
+ Include dependency graph for XrdAccAccess.cc:

Go to the source code of this file.

Macros

#define XrdAccSWAP(x)
 

Functions

XrdAccAuthorizeXrdAccDefaultAuthorizeObject (XrdSysLogger *lp, const char *cfn, const char *parm, XrdVersionInfo &urVer)
 
unsigned long XrdOucHashVal2 (const char *KeyVal, int KeyLen)
 

Variables

XrdAccConfig XrdAccConfiguration
 

Macro Definition Documentation

◆ XrdAccSWAP

#define XrdAccSWAP (   x)
Value:
oldtab.x = Atab.x; Atab.x = newtab.x; \
newtab.x = oldtab.x; oldtab.x = 0;

Definition at line 351 of file XrdAccAccess.cc.

Function Documentation

◆ XrdAccDefaultAuthorizeObject()

XrdAccAuthorize* XrdAccDefaultAuthorizeObject ( XrdSysLogger lp,
const char *  cfn,
const char *  parm,
XrdVersionInfo &  urVer 
)

Definition at line 64 of file XrdAccAccess.cc.

68 {
69  static XrdVERSIONINFODEF(myVer, XrdAcc, XrdVNUMBER, XrdVERSION);
70  static XrdSysError Eroute(lp, "acc_");
71 
72 // Verify version compatibility
73 //
74  if (urVer.vNum != myVer.vNum && !XrdSysPlugin::VerCmp(urVer,myVer))
75  return 0;
76 
77 // Configure the authorization system
78 //
79  if (XrdAccConfiguration.Configure(Eroute, cfn)) return (XrdAccAuthorize *)0;
80 
81 // Set error object pointer
82 //
83  XrdAccEntity::setError(&Eroute);
84 
85 // All is well, return the actual pointer to the object
86 //
88 }
XrdAccConfig XrdAccConfiguration
Definition: XrdAccConfig.cc:61
int Configure(XrdSysError &Eroute, const char *cfn)
XrdAccAccess * Authorization
Definition: XrdAccConfig.hh:78
static void setError(XrdSysError *errP)
static bool VerCmp(XrdVersionInfo &vInf1, XrdVersionInfo &vInf2, bool noMsg=false)
XrdVERSIONINFODEF(myVersion, cmsclient, XrdVNUMBER, XrdVERSION)

References XrdAccConfig::Authorization, XrdAccConfig::Configure(), XrdAccEntity::setError(), XrdSysPlugin::VerCmp(), XrdAccConfiguration, and XrdCms::XrdVERSIONINFODEF().

Referenced by main(), and XrdAccAuthorizeObject().

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

◆ XrdOucHashVal2()

unsigned long XrdOucHashVal2 ( const char *  KeyVal,
int  KeyLen 
)

Definition at line 40 of file XrdOucHashVal.cc.

41 { int j;
42  unsigned long *lp, lword, hval = 0;
43  int hl = sizeof(hval);
44 
45 // If name is shorter than the hash length, use the name.
46 //
47  if (KeyLen <= hl)
48  {memcpy(&hval, KeyVal, (size_t)KeyLen);
49  return hval;
50  }
51 
52 // Compute the length of the name and develop starting hash.
53 //
54  hval = KeyLen;
55  j = KeyLen % hl; KeyLen /= hl;
56  if (j)
57  {memcpy(&lword, KeyVal, (size_t)hl);
58  hval ^= lword;
59  }
60  lp = (unsigned long *)&KeyVal[j];
61 
62 // Compute and return the full hash.
63 //
64  while(KeyLen--)
65  {memcpy(&lword, lp++, (size_t)hl);
66  hval ^= lword;
67  }
68  return (hval ? hval : 1);
69 }

Referenced by XrdAccAccess::Access(), and XrdAccCapability::Privs().

+ Here is the caller graph for this function:

Variable Documentation

◆ XrdAccConfiguration

XrdAccConfig XrdAccConfiguration
extern