xrootd
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
XrdDigConfig.hh
Go to the documentation of this file.
1 #ifndef __XRDDIGCONFIG_HH__
2 #define __XRDDIGCONFIG_HH__
3 /******************************************************************************/
4 /* */
5 /* X r d D i g C o n f i g . h h */
6 /* */
7 /* (C) 2013 by the Board of Trustees of the Leland Stanford, Jr., University */
8 /* All Rights Reserved */
9 /* Produced by Andrew Hanushevsky for Stanford University under contract */
10 /* DE-AC02-76-SFO0515 with the Deprtment of Energy */
11 /* */
12 /* This file is part of the XRootD software suite. */
13 /* */
14 /* XRootD is free software: you can redistribute it and/or modify it under */
15 /* the terms of the GNU Lesser General Public License as published by the */
16 /* Free Software Foundation, either version 3 of the License, or (at your */
17 /* option) any later version. */
18 /* */
19 /* XRootD is distributed in the hope that it will be useful, but WITHOUT */
20 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
21 /* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */
22 /* License for more details. */
23 /* */
24 /* You should have received a copy of the GNU Lesser General Public License */
25 /* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */
26 /* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */
27 /* */
28 /* The copyright holder's institutional names and contributor's names may not */
29 /* be used to endorse or promote products derived from this software without */
30 /* specific prior written permission of the institution or contributor. */
31 /******************************************************************************/
32 
33 class XrdOucStream;
34 class XrdOucErrInfo;
35 class XrdSecEntity;
36 struct stat;
37 
39 {
40 public:
41 
42 
43 bool Configure(const char *cFN, const char *parms);
44 
45 enum pType {isAny = 0, isDir, isFile};
46 
47 int GenAccess(const XrdSecEntity *client,
48  const char *aList[],
49  int aMax);
50 
51 char *GenPath(int &rc, const XrdSecEntity *client, const char *opname,
52  const char *lfn, pType lfnType=isAny);
53 
54 void GetLocResp(XrdOucErrInfo &eInfo, bool nameok);
55 
56 static
57 void StatRoot(struct stat *sP);
58 
59  XrdDigConfig() : fnTmplt(0), logAcc(true), logRej(true) {}
61 
62 private:
63 
64 const char *AddPath(XrdDigConfig::pType sType, const char *src,
65  const char *tpd, const char *tfn);
66 void Audit(const XrdSecEntity *client, const char *what,
67  const char *opn, const char *trg);
68 bool ConfigProc(const char *ConfigFN);
69 bool ConfigXeq(char *var, XrdOucStream &cFile);
70 void Empty(const char *path);
71 void SetLocResp();
72 int ValProc(const char *ppath);
73 bool xacf(XrdOucStream &cFile);
74 bool xlog(XrdOucStream &cFile);
75 
76 char *fnTmplt;
77 char *locRespHP;
78 char *locRespV6;
79 char *locRespV4;
80 short locRlenHP;
81 short locRlenV6;
82 short locRlenV4;
83 bool logAcc;
84 bool logRej;
85 };
86 #endif
char * locRespHP
Definition: XrdDigConfig.hh:77
short locRlenV6
Definition: XrdDigConfig.hh:81
bool ConfigXeq(char *var, XrdOucStream &cFile)
Definition: XrdDigConfig.hh:45
static void StatRoot(struct stat *sP)
pType
Definition: XrdDigConfig.hh:45
Definition: XrdOucStream.hh:46
Definition: XrdDigConfig.hh:38
short locRlenV4
Definition: XrdDigConfig.hh:82
bool logAcc
Definition: XrdDigConfig.hh:83
char * GenPath(int &rc, const XrdSecEntity *client, const char *opname, const char *lfn, pType lfnType=isAny)
bool Configure(const char *cFN, const char *parms)
char * fnTmplt
Definition: XrdDigConfig.hh:76
void GetLocResp(XrdOucErrInfo &eInfo, bool nameok)
bool logRej
Definition: XrdDigConfig.hh:84
const char * AddPath(XrdDigConfig::pType sType, const char *src, const char *tpd, const char *tfn)
Definition: XrdOucErrInfo.hh:100
short locRlenHP
Definition: XrdDigConfig.hh:80
char * locRespV6
Definition: XrdDigConfig.hh:78
int GenAccess(const XrdSecEntity *client, const char *aList[], int aMax)
Definition: XrdDigConfig.hh:45
XrdDigConfig()
Definition: XrdDigConfig.hh:59
void Empty(const char *path)
#define stat(a, b)
Definition: XrdPosix.hh:96
char * locRespV4
Definition: XrdDigConfig.hh:79
bool xacf(XrdOucStream &cFile)
Definition: XrdSecEntity.hh:63
int ValProc(const char *ppath)
void SetLocResp()
void Audit(const XrdSecEntity *client, const char *what, const char *opn, const char *trg)
Definition: XrdDigConfig.hh:45
bool xlog(XrdOucStream &cFile)
bool ConfigProc(const char *ConfigFN)
~XrdDigConfig()
Definition: XrdDigConfig.hh:60