PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
hba.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * hba.h
4  * Interface to hba.c
5  *
6  *
7  * src/include/libpq/hba.h
8  *
9  *-------------------------------------------------------------------------
10  */
11 #ifndef HBA_H
12 #define HBA_H
13 
14 #include "libpq/pqcomm.h" /* pgrminclude ignore */ /* needed for NetBSD */
15 #include "nodes/pg_list.h"
16 #include "regex/regex.h"
17 
18 
19 /*
20  * The following enum represents the authentication methods that
21  * are supported by PostgreSQL.
22  *
23  * Note: keep this in sync with the UserAuthName array in hba.c.
24  */
25 typedef enum UserAuth
26 {
28  uaImplicitReject, /* Not a user-visible option */
40  uaPeer
41 #define USER_AUTH_LAST uaPeer /* Must be last value of this enum */
42 } UserAuth;
43 
44 typedef enum IPCompareMethod
45 {
51 
52 typedef enum ConnType
53 {
58 } ConnType;
59 
60 typedef struct HbaLine
61 {
63  char *rawline;
70  char *hostname;
72 
73  char *usermap;
74  char *pamservice;
76  bool ldaptls;
77  char *ldapserver;
78  int ldapport;
79  char *ldapbinddn;
82  char *ldapbasedn;
83  int ldapscope;
84  char *ldapprefix;
85  char *ldapsuffix;
86  bool clientcert;
87  char *krb_realm;
91  char *radiusserver;
92  char *radiussecret;
95 } HbaLine;
96 
97 typedef struct IdentLine
98 {
100 
101  char *usermap;
102  char *ident_user;
103  char *pg_role;
105 } IdentLine;
106 
107 /* kluge to avoid including libpq/libpq-be.h here */
108 typedef struct Port hbaPort;
109 
110 extern bool load_hba(void);
111 extern bool load_ident(void);
112 extern void hba_getauthmethod(hbaPort *port);
113 extern int check_usermap(const char *usermap_name,
114  const char *pg_role, const char *auth_user,
115  bool case_sensitive);
116 extern bool pg_isblank(const char c);
117 
118 #endif /* HBA_H */
int ldapscope
Definition: hba.h:83
UserAuth
Definition: hba.h:25
List * databases
Definition: hba.h:65
Definition: hba.h:60
Definition: hba.h:30
char * ldapserver
Definition: hba.h:77
struct sockaddr_storage mask
Definition: hba.h:68
Definition: hba.h:37
struct IdentLine IdentLine
int ldapport
Definition: hba.h:78
void hba_getauthmethod(hbaPort *port)
Definition: hba.c:2838
char * ldapbasedn
Definition: hba.h:82
Definition: hba.h:32
char * pamservice
Definition: hba.h:74
regex_t re
Definition: hba.h:104
Definition: hba.h:46
Definition: hba.h:34
Definition: libpq-be.h:118
struct HbaLine HbaLine
bool load_hba(void)
Definition: hba.c:1945
int check_usermap(const char *usermap_name, const char *pg_role, const char *auth_user, bool case_sensitive)
Definition: hba.c:2672
char * ldapsuffix
Definition: hba.h:85
int linenumber
Definition: hba.h:99
Definition: hba.h:33
Definition: hba.h:31
char * radiussecret
Definition: hba.h:92
char * radiusserver
Definition: hba.h:91
ConnType conntype
Definition: hba.h:64
Definition: hba.h:56
bool pam_use_hostname
Definition: hba.h:75
Definition: hba.h:38
int radiusport
Definition: hba.h:94
struct sockaddr_storage addr
Definition: hba.h:67
char * usermap
Definition: hba.h:101
char * usermap
Definition: hba.h:73
Definition: hba.h:27
bool include_realm
Definition: hba.h:88
Definition: hba.h:29
char * c
ConnType
Definition: hba.h:52
char * ldapbinddn
Definition: hba.h:79
char * krb_realm
Definition: hba.h:87
int linenumber
Definition: hba.h:62
char * radiusidentifier
Definition: hba.h:93
IPCompareMethod
Definition: hba.h:44
char * ldapbindpasswd
Definition: hba.h:80
bool load_ident(void)
Definition: hba.c:2727
char * ldapprefix
Definition: hba.h:84
Definition: hba.h:54
static int port
Definition: pg_regress.c:87
Definition: hba.h:49
char * hostname
Definition: hba.h:70
Definition: hba.h:36
List * roles
Definition: hba.h:66
Definition: hba.h:97
bool ldaptls
Definition: hba.h:76
char * ldapsearchattribute
Definition: hba.h:81
char * rawline
Definition: hba.h:63
bool upn_username
Definition: hba.h:90
char * ident_user
Definition: hba.h:102
bool pg_isblank(const char c)
Definition: hba.c:159
bool clientcert
Definition: hba.h:86
IPCompareMethod ip_cmp_method
Definition: hba.h:69
Definition: pg_list.h:45
Definition: hba.h:35
bool compat_realm
Definition: hba.h:89
Definition: regex.h:55
Definition: hba.h:55
char * pg_role
Definition: hba.h:103
UserAuth auth_method
Definition: hba.h:71
Definition: hba.h:39