xrootd
XrdAccAuthDB.hh
Go to the documentation of this file.
1 #ifndef __ACC_AUTHDB__
2 #define __ACC_AUTHDB__
3 /******************************************************************************/
4 /* */
5 /* X r d A c c A u t h D B . 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 Department of Energy */
11 /******************************************************************************/
12 
13 // $Id$
14 
15 #include "XrdSys/XrdSysError.hh"
16 
17 // This class is provided for obtaining capability information from some source.
18 // Derive a class to provide an actual source for the information. The
19 // interface is similar to the set/get/endpwent enumeration interface:
20 
21 // setDBpath() is used to establish the location of the database.
22 
23 // Open() establishes the start of the database operation. It also obtains
24 // an exclusive mutex to be mt-safe. True is returned upon success.
25 
26 // getRec() get the next database record. It returns the record type as well
27 // as a pointer to the record name. False is returned at the end
28 // of the database.
29 
30 // getPP() gets the next path-priv or template name. It returns a pointer
31 // to each one. True is returned until end-of-record.
32 
33 // Close() terminates database processing and releases the associated lock.
34 // It also return FALSE if any errors occured during processing.
35 
36 // Changed() Returns 1 id the current authorization file has changed since
37 // the last time it was opened.
38 
39 
40 /******************************************************************************/
41 /* D a t a b a s e R e c o r d T y p e s */
42 /******************************************************************************/
43 
44 // The following are the 1-letter id types that we support
45 //
46 // g -> unix group name
47 // h -> host name
48 // n -> NIS netgroup name
49 // s -> set name
50 // t -> template name
51 // u -> user name
52 
53 // The syntax for each database record is:
54 
55 // <RecType> <recname> {<tname>|<path> <priv>} [{<tname|<path> <priv>}] [...]
56 
57 // Continuation records are signified by an ending backslash (\). Blank records
58 // and comments (i.e., lines with the first non-blank being a pound sign) are
59 // allowed. Word separators may be spaces or tabs.
60 
61 /******************************************************************************/
62 /* X r d A c c A u t h D B C l a s s */
63 /******************************************************************************/
64 
66 {
67 public:
68 
69 virtual int Open(XrdSysError &eroute, const char *path=0) = 0;
70 
71 virtual char getRec(char **recname) = 0;
72 
73 virtual int getPP(char **path, char **priv) = 0;
74 
75 virtual int Close() = 0;
76 
77 virtual int Changed(const char *path=0) = 0;
78 
80 virtual ~XrdAccAuthDB() {}
81 
82 };
83 
84 /******************************************************************************/
85 /* X r d A c c X u t h D B _ O b j e c t */
86 /******************************************************************************/
87 
89 
90 #endif