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/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
//
44
class
XrdAccAuthFile
:
public
XrdAccAuthDB
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
60
XrdAccAuthFile
(
XrdSysError
*erp);
61
~XrdAccAuthFile
();
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
70
XrdSysError
*Eroute;
71
DBflags flags;
72
XrdOucStream
DBfile;
73
char
*authfn;
74
char
rectype;
75
time_t modtime;
76
XrdSysMutex
DBcontext;
77
78
char
recname_buff[MAXHOSTNAMELEN+1];
// Max record name by default
79
char
path_buff[MAXPATHLEN+2];
// Max path name
80
};
81
#endif
XrdAccAuthDB.hh
XrdOucStream.hh
XrdSysError.hh
XrdSysPlatform.hh
XrdSysPthread.hh
XrdAccAuthDB
Definition:
XrdAccAuthDB.hh:86
XrdAccAuthFile
Definition:
XrdAccAuthFile.hh:45
XrdAccAuthFile::~XrdAccAuthFile
~XrdAccAuthFile()
Definition:
XrdAccAuthFile.cc:73
XrdAccAuthFile::getRec
char getRec(char **recname)
Definition:
XrdAccAuthFile.cc:258
XrdAccAuthFile::Open
int Open(XrdSysError &eroute, const char *path=0)
Definition:
XrdAccAuthFile.cc:325
XrdAccAuthFile::Changed
int Changed(const char *dbpath)
Definition:
XrdAccAuthFile.cc:89
XrdAccAuthFile::XrdAccAuthFile
XrdAccAuthFile(XrdSysError *erp)
Definition:
XrdAccAuthFile.cc:54
XrdAccAuthFile::getPP
int getPP(char **path, char **priv, bool &istmplt)
Definition:
XrdAccAuthFile.cc:194
XrdAccAuthFile::getID
char getID(char **id)
Definition:
XrdAccAuthFile.cc:145
XrdAccAuthFile::Close
int Close()
Definition:
XrdAccAuthFile.cc:117
XrdOucStream
Definition:
XrdOucStream.hh:47
XrdSysError
Definition:
XrdSysError.hh:90
XrdSysMutex
Definition:
XrdSysPthread.hh:165
XrdAcc
XrdAccAuthFile.hh
Generated by
1.9.1