xrootd
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/XrdSysPthread.hh"
38 #include "XrdOuc/XrdOucStream.hh"
39 #include "XrdAcc/XrdAccAuthDB.hh"
40 
41 // This class is provided for obtaining capability information from a file.
42 //
44 {
45 public:
46 
47 int Open(XrdSysError &eroute, const char *path=0);
48 
49 char getRec(char **recname);
50 
51 char getID(char **id);
52 
53 int getPP(char **path, char **priv, bool &istmplt);
54 
55 int Close();
56 
57 int Changed(const char *dbpath);
58 
61 
62 private:
63 
64 int Bail(int retc, const char *txt1, const char *txt2=0);
65 char *Copy(char *dp, char *sp, int dplen);
66 
67 enum DBflags {Noflags=0, inRec=1, isOpen=2, dbError=4}; // Values combined
68 
72 char *authfn;
73 char rectype;
74 time_t modtime;
76 
77 char recname_buff[MAXHOSTNAMELEN+1]; // Max record name by default
78 char path_buff[PATH_MAX+2]; // Max path name
79 };
80 #endif
int getPP(char **path, char **priv, bool &istmplt)
Definition: XrdAccAuthFile.hh:67
time_t modtime
Definition: XrdAccAuthFile.hh:74
Definition: XrdOucStream.hh:45
Definition: XrdAccAuthFile.hh:67
XrdSysError * Eroute
Definition: XrdAccAuthFile.hh:69
Definition: XrdSysError.hh:89
Definition: XrdAccAuthFile.hh:43
Definition: XrdSysPthread.hh:165
int Bail(int retc, const char *txt1, const char *txt2=0)
char rectype
Definition: XrdAccAuthFile.hh:73
char getRec(char **recname)
int Changed(const char *dbpath)
int Open(XrdSysError &eroute, const char *path=0)
Definition: XrdAccAuthFile.hh:67
char recname_buff[MAXHOSTNAMELEN+1]
Definition: XrdAccAuthFile.hh:77
char * authfn
Definition: XrdAccAuthFile.hh:72
XrdOucStream DBfile
Definition: XrdAccAuthFile.hh:71
DBflags
Definition: XrdAccAuthFile.hh:67
XrdSysMutex DBcontext
Definition: XrdAccAuthFile.hh:75
DBflags flags
Definition: XrdAccAuthFile.hh:70
char * Copy(char *dp, char *sp, int dplen)
Definition: XrdAccAuthFile.hh:67
XrdAccAuthFile(XrdSysError *erp)
char getID(char **id)
Definition: XrdAccAuthDB.hh:85
char path_buff[PATH_MAX+2]
Definition: XrdAccAuthFile.hh:78