xrootd
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
XrdAccConfig.hh
Go to the documentation of this file.
1 #ifndef _ACC_CONFIG_H
2 #define _ACC_CONFIG_H
3 /******************************************************************************/
4 /* */
5 /* X r d A c c C o n f i g . h h */
6 /* */
7 /* (C) 2003 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 #include <sys/types.h>
34 
35 #include "XrdOuc/XrdOuca2x.hh"
36 #include "XrdSys/XrdSysError.hh"
37 #include "XrdOuc/XrdOucHash.hh"
38 #include "XrdSys/XrdSysPthread.hh"
39 #include "XrdOuc/XrdOucStream.hh"
40 #include "XrdAcc/XrdAccAccess.hh"
41 #include "XrdAcc/XrdAccAuthDB.hh"
43 #include "XrdAcc/XrdAccGroups.hh"
44 
45 /******************************************************************************/
46 /* X r d A c c G l i s t */
47 /******************************************************************************/
48 
49 struct XrdAccGlist
50 {
51  struct XrdAccGlist *next; /* Null if this is the last one */
52  char *name; /* -> null terminated name */
53 
54  XrdAccGlist(const char *Name, struct XrdAccGlist *Next=0)
55  {name = strdup(Name); next = Next;}
57  {if (name) free(name);}
58 };
59 
60 /******************************************************************************/
61 /* X r d A c c C o n f i g */
62 /******************************************************************************/
63 
65 {
66 public:
67 
68 // Configure() is called during initialization.
69 //
70 int Configure(XrdSysError &Eroute, const char *cfn);
71 
72 // ConfigDB() simply refreshes the in-core authorization database. When the
73 // Warm is true, a check is made whether the database actually changed and the
74 // refresh is skipped if it has not changed.
75 //
76 int ConfigDB(int Warm, XrdSysError &Eroute);
77 
80 
81 int AuthRT;
82 
83  XrdAccConfig();
84  ~XrdAccConfig() {} // Configuration is never destroyed!
85 
86 private:
87 
88 struct XrdAccGlist *addGlist(gid_t Gid, const char *Gname,
89  struct XrdAccGlist *Gnext);
90 int ConfigDBrec(XrdSysError &Eroute,
91  struct XrdAccAccess_Tables &tabs);
92 void ConfigDefaults(void);
93 int ConfigFile(XrdSysError &Eroute, const char *cfn);
94 int ConfigXeq(char *, XrdOucStream &, XrdSysError &);
95 void idChk(XrdSysError &Eroute, XrdAccAccess_ID *idList,
96  XrdAccAccess_Tables &tabs);
97 int idDef(XrdSysError &Eroute, XrdAccAccess_Tables &tabs,
98  const char *idName);
99 void subSpace(char *id);
100 int PrivsConvert(char *privs, XrdAccPrivCaps &ctab);
101 
102 int xaud(XrdOucStream &Config, XrdSysError &Eroute);
103 int xart(XrdOucStream &Config, XrdSysError &Eroute);
104 int xdbp(XrdOucStream &Config, XrdSysError &Eroute);
105 int xenc(XrdOucStream &Config, XrdSysError &Eroute);
106 int xglt(XrdOucStream &Config, XrdSysError &Eroute);
107 int xgrt(XrdOucStream &Config, XrdSysError &Eroute);
108 int xnis(XrdOucStream &Cofig, XrdSysError &Eroute);
109 int xspc(XrdOucStream &Cofig, XrdSysError &Eroute);
110 
112 char *dbpath;
113 
116 
119 char spChar;
120 bool uriPath;
121 };
122 #endif
int xnis(XrdOucStream &Cofig, XrdSysError &Eroute)
int PrivsConvert(char *privs, XrdAccPrivCaps &ctab)
int xgrt(XrdOucStream &Config, XrdSysError &Eroute)
Definition: XrdAccAccess.hh:127
int xenc(XrdOucStream &Config, XrdSysError &Eroute)
int Configure(XrdSysError &Eroute, const char *cfn)
int ConfigFile(XrdSysError &Eroute, const char *cfn)
Definition: XrdAccConfig.hh:49
Definition: XrdOucStream.hh:46
void subSpace(char *id)
void idChk(XrdSysError &Eroute, XrdAccAccess_ID *idList, XrdAccAccess_Tables &tabs)
Definition: XrdSysPthread.hh:550
int xdbp(XrdOucStream &Config, XrdSysError &Eroute)
Definition: XrdSysError.hh:89
Definition: XrdAccGroups.hh:96
int ConfigXeq(char *, XrdOucStream &, XrdSysError &)
Definition: XrdSysPthread.hh:164
XrdCmsConfig Config
int AuthRT
Definition: XrdAccConfig.hh:81
XrdAccAuthDB * Database
Definition: XrdAccConfig.hh:111
XrdAccAccess * Authorization
Definition: XrdAccConfig.hh:78
char * name
Definition: XrdAccConfig.hh:52
~XrdAccGlist()
Definition: XrdAccConfig.hh:56
struct XrdAccGlist * next
Definition: XrdAccConfig.hh:51
Definition: XrdAccPrivs.hh:77
int ConfigDB(int Warm, XrdSysError &Eroute)
int xart(XrdOucStream &Config, XrdSysError &Eroute)
bool uriPath
Definition: XrdAccConfig.hh:120
char spChar
Definition: XrdAccConfig.hh:119
int ConfigDBrec(XrdSysError &Eroute, struct XrdAccAccess_Tables &tabs)
char * dbpath
Definition: XrdAccConfig.hh:112
XrdAccGroups GroupMaster
Definition: XrdAccConfig.hh:79
struct XrdAccGlist * addGlist(gid_t Gid, const char *Gname, struct XrdAccGlist *Gnext)
int options
Definition: XrdAccConfig.hh:117
int xaud(XrdOucStream &Config, XrdSysError &Eroute)
~XrdAccConfig()
Definition: XrdAccConfig.hh:84
void ConfigDefaults(void)
Definition: XrdAccAccess.hh:47
Definition: XrdAccAccess.hh:85
Definition: XrdAccConfig.hh:64
int xglt(XrdOucStream &Config, XrdSysError &Eroute)
int xspc(XrdOucStream &Cofig, XrdSysError &Eroute)
XrdSysMutex Config_Context
Definition: XrdAccConfig.hh:114
XrdAccGlist(const char *Name, struct XrdAccGlist *Next=0)
Definition: XrdAccConfig.hh:54
XrdSysThread Config_Refresh
Definition: XrdAccConfig.hh:115
Definition: XrdAccAuthDB.hh:85
int rulenum
Definition: XrdAccConfig.hh:118
int idDef(XrdSysError &Eroute, XrdAccAccess_Tables &tabs, const char *idName)