xrootd
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-AC03-76-SFO0515 with the Deprtment of Energy */
11 /******************************************************************************/
12 
13 // $Id$
14 
15 #include <sys/types.h>
16 
17 #include "XrdOuc/XrdOuca2x.hh"
18 #include "XrdSys/XrdSysError.hh"
19 #include "XrdOuc/XrdOucHash.hh"
20 #include "XrdSys/XrdSysPthread.hh"
21 #include "XrdOuc/XrdOucStream.hh"
22 #include "XrdAcc/XrdAccAccess.hh"
23 #include "XrdAcc/XrdAccAuthDB.hh"
25 #include "XrdAcc/XrdAccGroups.hh"
26 
27 /******************************************************************************/
28 /* X r d A c c G l i s t */
29 /******************************************************************************/
30 
31 struct XrdAccGlist
32 {
33  struct XrdAccGlist *next; /* Null if this is the last one */
34  char *name; /* -> null terminated name */
35 
36  XrdAccGlist(const char *Name, struct XrdAccGlist *Next=0)
37  {name = strdup(Name); next = Next;}
39  {if (name) free(name);}
40 };
41 
42 /******************************************************************************/
43 /* X r d A c c C o n f i g */
44 /******************************************************************************/
45 
47 {
48 public:
49 
50 // Configure() is called during initialization.
51 //
52 int Configure(XrdSysError &Eroute, const char *cfn);
53 
54 // ConfigDB() simply refreshes the in-core authorization database. When the
55 // Warm is true, a check is made whether the database actually changed and the
56 // refresh is skipped if it has not changed.
57 //
58 int ConfigDB(int Warm, XrdSysError &Eroute);
59 
62 
63 int AuthRT;
64 
65  XrdAccConfig();
66  ~XrdAccConfig() {} // Configuration is never destroyed!
67 
68 private:
69 
70 struct XrdAccGlist *addGlist(gid_t Gid, const char *Gname,
71  struct XrdAccGlist *Gnext);
72 int ConfigDBrec(XrdSysError &Eroute,
73  struct XrdAccAccess_Tables &tabs);
74 void ConfigDefaults(void);
75 int ConfigFile(XrdSysError &Eroute, const char *cfn);
76 int ConfigXeq(char *, XrdOucStream &, XrdSysError &);
77 int PrivsConvert(char *privs, XrdAccPrivCaps &ctab);
78 int xaud(XrdOucStream &Config, XrdSysError &Eroute);
79 int xart(XrdOucStream &Config, XrdSysError &Eroute);
80 int xdbp(XrdOucStream &Config, XrdSysError &Eroute);
81 int xglt(XrdOucStream &Config, XrdSysError &Eroute);
82 int xgrt(XrdOucStream &Config, XrdSysError &Eroute);
83 int xnis(XrdOucStream &Cofig, XrdSysError &Eroute);
84 
86 char *dbpath;
87 
90 
91 int options;
92 };
93 #endif