00001 #ifndef __ACC_AUTHDB__ 00002 #define __ACC_AUTHDB__ 00003 /******************************************************************************/ 00004 /* */ 00005 /* X r d A c c A u t h D B . h h */ 00006 /* */ 00007 /* (c) 2003 by the Board of Trustees of the Leland Stanford, Jr., University */ 00008 /* All Rights Reserved */ 00009 /* Produced by Andrew Hanushevsky for Stanford University under contract */ 00010 /* DE-AC03-76-SFO0515 with the Department of Energy */ 00011 /******************************************************************************/ 00012 00013 // $Id: XrdAccAuthDB.hh 22437 2008-03-04 14:35:16Z rdm $ 00014 00015 #include "XrdSys/XrdSysError.hh" 00016 00017 // This class is provided for obtaining capability information from some source. 00018 // Derive a class to provide an actual source for the information. The 00019 // interface is similar to the set/get/endpwent enumeration interface: 00020 00021 // setDBpath() is used to establish the location of the database. 00022 00023 // Open() establishes the start of the database operation. It also obtains 00024 // an exclusive mutex to be mt-safe. True is returned upon success. 00025 00026 // getRec() get the next database record. It returns the record type as well 00027 // as a pointer to the record name. False is returned at the end 00028 // of the database. 00029 00030 // getPP() gets the next path-priv or template name. It returns a pointer 00031 // to each one. True is returned until end-of-record. 00032 00033 // Close() terminates database processing and releases the associated lock. 00034 // It also return FALSE if any errors occured during processing. 00035 00036 // Changed() Returns 1 id the current authorization file has changed since 00037 // the last time it was opened. 00038 00039 00040 /******************************************************************************/ 00041 /* D a t a b a s e R e c o r d T y p e s */ 00042 /******************************************************************************/ 00043 00044 // The following are the 1-letter id types that we support 00045 // 00046 // g -> unix group name 00047 // h -> host name 00048 // n -> NIS netgroup name 00049 // s -> set name 00050 // t -> template name 00051 // u -> user name 00052 00053 // The syntax for each database record is: 00054 00055 // <RecType> <recname> {<tname>|<path> <priv>} [{<tname|<path> <priv>}] [...] 00056 00057 // Continuation records are signified by an ending backslash (\). Blank records 00058 // and comments (i.e., lines with the first non-blank being a pound sign) are 00059 // allowed. Word separators may be spaces or tabs. 00060 00061 /******************************************************************************/ 00062 /* X r d A c c A u t h D B C l a s s */ 00063 /******************************************************************************/ 00064 00065 class XrdAccAuthDB 00066 { 00067 public: 00068 00069 virtual int Open(XrdSysError &eroute, const char *path=0) = 0; 00070 00071 virtual char getRec(char **recname) = 0; 00072 00073 virtual int getPP(char **path, char **priv) = 0; 00074 00075 virtual int Close() = 0; 00076 00077 virtual int Changed(const char *path=0) = 0; 00078 00079 XrdAccAuthDB() {} 00080 virtual ~XrdAccAuthDB() {} 00081 00082 }; 00083 00084 /******************************************************************************/ 00085 /* X r d A c c X u t h D B _ O b j e c t */ 00086 /******************************************************************************/ 00087 00088 extern XrdAccAuthDB *XrdAccAuthDBObject(XrdSysError *erp); 00089 00090 #endif