00001 #ifndef __ACC_AUTHFILE__ 00002 #define __ACC_AUTHFILE__ 00003 /******************************************************************************/ 00004 /* */ 00005 /* X r d A c c A u t h F i l e . 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: XrdAccAuthFile.hh 22437 2008-03-04 14:35:16Z rdm $ 00014 00015 #include <limits.h> 00016 #include <netdb.h> 00017 #include <sys/param.h> 00018 #include "XrdSys/XrdSysError.hh" 00019 #include "XrdSys/XrdSysPthread.hh" 00020 #include "XrdOuc/XrdOucStream.hh" 00021 #include "XrdAcc/XrdAccAuthDB.hh" 00022 00023 // This class is provided for obtaining capability information from a file. 00024 // 00025 class XrdAccAuthFile : public XrdAccAuthDB 00026 { 00027 public: 00028 00029 int Open(XrdSysError &eroute, const char *path=0); 00030 00031 char getRec(char **recname); 00032 00033 int getPP(char **path, char **priv); 00034 00035 int Close(); 00036 00037 int Changed(const char *dbpath); 00038 00039 XrdAccAuthFile(XrdSysError *erp); 00040 ~XrdAccAuthFile(); 00041 00042 private: 00043 00044 int Bail(int retc, const char *txt1, const char *txt2=0); 00045 char *Copy(char *dp, char *sp, int dplen); 00046 00047 enum DBflags {Noflags=0, inRec=1, isOpen=2, dbError=4}; // Values combined 00048 00049 XrdSysError *Eroute; 00050 DBflags flags; 00051 XrdOucStream DBfile; 00052 char *authfn; 00053 char rectype; 00054 time_t modtime; 00055 XrdSysMutex DBcontext; 00056 00057 char recname_buff[MAXHOSTNAMELEN+1]; // Max record name by default 00058 char path_buff[PATH_MAX+2]; // Max path name 00059 }; 00060 #endif