xrootd
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
XrdAccAuthFile.hh
Go to the documentation of this file.
1 #ifndef __ACC_AUTHFILE__
2 #define __ACC_AUTHFILE__
3 /******************************************************************************/
4 /* */
5 /* X r d A c c A u t h F i l e . 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 Department 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 <limits.h>
34 #include <netdb.h>
35 #include <sys/param.h>
36 #include "XrdSys/XrdSysError.hh"
37 #include "XrdSys/XrdSysPlatform.hh"
38 #include "XrdSys/XrdSysPthread.hh"
39 #include "XrdOuc/XrdOucStream.hh"
40 #include "XrdAcc/XrdAccAuthDB.hh"
41 
42 // This class is provided for obtaining capability information from a file.
43 //
45 {
46 public:
47 
48 int Open(XrdSysError &eroute, const char *path=0);
49 
50 char getRec(char **recname);
51 
52 char getID(char **id);
53 
54 int getPP(char **path, char **priv, bool &istmplt);
55 
56 int Close();
57 
58 int Changed(const char *dbpath);
59 
62 
63 private:
64 
65 int Bail(int retc, const char *txt1, const char *txt2=0);
66 char *Copy(char *dp, char *sp, int dplen);
67 
68 enum DBflags {Noflags=0, inRec=1, isOpen=2, dbError=4}; // Values combined
69 
73 char *authfn;
74 char rectype;
75 time_t modtime;
77 
78 char recname_buff[MAXHOSTNAMELEN+1]; // Max record name by default
79 char path_buff[MAXPATHLEN+2]; // Max path name
80 };
81 #endif
int getPP(char **path, char **priv, bool &istmplt)
Definition: XrdAccAuthFile.hh:68
time_t modtime
Definition: XrdAccAuthFile.hh:75
Definition: XrdOucStream.hh:46
Definition: XrdAccAuthFile.hh:68
XrdSysError * Eroute
Definition: XrdAccAuthFile.hh:70
Definition: XrdSysError.hh:89
Definition: XrdAccAuthFile.hh:44
Definition: XrdSysPthread.hh:164
int Bail(int retc, const char *txt1, const char *txt2=0)
char rectype
Definition: XrdAccAuthFile.hh:74
char getRec(char **recname)
int Changed(const char *dbpath)
int Open(XrdSysError &eroute, const char *path=0)
Definition: XrdAccAuthFile.hh:68
char recname_buff[MAXHOSTNAMELEN+1]
Definition: XrdAccAuthFile.hh:78
char path_buff[MAXPATHLEN+2]
Definition: XrdAccAuthFile.hh:79
char * authfn
Definition: XrdAccAuthFile.hh:73
XrdOucStream DBfile
Definition: XrdAccAuthFile.hh:72
DBflags
Definition: XrdAccAuthFile.hh:68
XrdSysMutex DBcontext
Definition: XrdAccAuthFile.hh:76
DBflags flags
Definition: XrdAccAuthFile.hh:71
char * Copy(char *dp, char *sp, int dplen)
Definition: XrdAccAuthFile.hh:68
XrdAccAuthFile(XrdSysError *erp)
char getID(char **id)
Definition: XrdAccAuthDB.hh:85