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

XrdAccAuthorize * XrdAccDefaultAuthorizeObject (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 353 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 57 of file XrdOucHashVal.cc.

58 { int j;
59  const char *cp;
60  unsigned long hval = 0;
61  int hl = sizeof(hval);
62 
63 // If name is shorter than the hash length, use the name.
64 //
65  if (KeyLen <= hl) return LoadWord(KeyVal, (size_t)KeyLen);
66 
67 // Compute the length of the name and develop starting hash.
68 //
69  hval = KeyLen;
70  j = KeyLen % hl; KeyLen /= hl;
71  if (j) hval ^= LoadWord(KeyVal);
72  cp = &KeyVal[j];
73 
74 // Compute and return the full hash. The key is walked with a byte pointer
75 // since it is not aligned for unsigned long; LoadWord() does the unaligned
76 // load, and the word arithmetic happens on the copy.
77 //
78  while(KeyLen--)
79  {hval ^= LoadWord(cp);
80  cp += hl;
81  }
82  return (hval ? hval : 1);
83 }

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

+ Here is the caller graph for this function:

Variable Documentation

◆ XrdAccConfiguration

XrdAccConfig XrdAccConfiguration
extern