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