PostgreSQL Source Code
git master
|
Go to the source code of this file.
Data Structures | |
struct | HbaLine |
struct | IdentLine |
struct | AuthToken |
struct | TokenizedAuthLine |
Macros | |
#define | USER_AUTH_LAST uaPeer /* Must be last value of this enum */ |
Typedefs | |
typedef enum UserAuth | UserAuth |
typedef enum IPCompareMethod | IPCompareMethod |
typedef enum ConnType | ConnType |
typedef enum ClientCertMode | ClientCertMode |
typedef enum ClientCertName | ClientCertName |
typedef struct HbaLine | HbaLine |
typedef struct IdentLine | IdentLine |
typedef struct AuthToken | AuthToken |
typedef struct TokenizedAuthLine | TokenizedAuthLine |
typedef struct Port | hbaPort |
Enumerations | |
enum | UserAuth { uaReject , uaImplicitReject , uaTrust , uaIdent , uaPassword , uaMD5 , uaSCRAM , uaGSS , uaSSPI , uaPAM , uaBSD , uaLDAP , uaCert , uaRADIUS } |
enum | IPCompareMethod { ipCmpMask , ipCmpSameHost , ipCmpSameNet , ipCmpAll } |
enum | ConnType { ctLocal , ctHost , ctHostSSL , ctHostNoSSL , ctHostGSS , ctHostNoGSS } |
enum | ClientCertMode { clientCertOff , clientCertCA , clientCertFull } |
enum | ClientCertName { clientCertCN , clientCertDN } |
Functions | |
bool | load_hba (void) |
bool | load_ident (void) |
const char * | hba_authname (UserAuth auth_method) |
void | hba_getauthmethod (hbaPort *port) |
int | check_usermap (const char *usermap_name, const char *pg_role, const char *auth_user, bool case_sensitive) |
HbaLine * | parse_hba_line (TokenizedAuthLine *tok_line, int elevel) |
IdentLine * | parse_ident_line (TokenizedAuthLine *tok_line, int elevel) |
bool | pg_isblank (const char c) |
MemoryContext | tokenize_auth_file (const char *filename, FILE *file, List **tok_lines, int elevel) |
#define USER_AUTH_LAST uaPeer /* Must be last value of this enum */ |
typedef enum ClientCertMode ClientCertMode |
typedef enum ClientCertName ClientCertName |
typedef enum IPCompareMethod IPCompareMethod |
typedef struct TokenizedAuthLine TokenizedAuthLine |
enum ClientCertMode |
enum ClientCertName |
enum ConnType |
enum IPCompareMethod |
enum UserAuth |
int check_usermap | ( | const char * | usermap_name, |
const char * | pg_role, | ||
const char * | auth_user, | ||
bool | case_sensitive | ||
) |
Definition at line 2531 of file hba.c.
References check_ident_usermap(), ereport, errmsg(), error(), lfirst, LOG, parsed_ident_lines, pg_strcasecmp(), STATUS_ERROR, and STATUS_OK.
Referenced by auth_peer(), and ident_inet().
const char* hba_authname | ( | UserAuth | auth_method | ) |
Definition at line 2710 of file hba.c.
References lengthof, StaticAssertStmt, USER_AUTH_LAST, and UserAuthName.
Referenced by fill_hba_line(), and set_authn_id().
void hba_getauthmethod | ( | hbaPort * | port | ) |
Definition at line 2697 of file hba.c.
References check_hba(), and port.
Referenced by ClientAuthentication().
bool load_hba | ( | void | ) |
Definition at line 2207 of file hba.c.
References AllocateFile(), ALLOCSET_SMALL_SIZES, AllocSetContextCreate, Assert(), ereport, TokenizedAuthLine::err_msg, errcode(), errcode_for_file_access(), errmsg(), FreeFile(), HbaFileName, lappend(), lfirst, LOG, MemoryContextDelete(), MemoryContextSwitchTo(), newline(), NIL, parse_hba_line(), parsed_hba_context, parsed_hba_lines, PostmasterContext, and tokenize_auth_file().
Referenced by PerformAuthentication(), PostmasterMain(), and SIGHUP_handler().
bool load_ident | ( | void | ) |
Definition at line 2586 of file hba.c.
References AllocateFile(), ALLOCSET_SMALL_SIZES, AllocSetContextCreate, Assert(), ereport, TokenizedAuthLine::err_msg, errcode_for_file_access(), errmsg(), FreeFile(), IdentFileName, lappend(), lfirst, LOG, MemoryContextDelete(), MemoryContextSwitchTo(), newline(), NIL, parse_ident_line(), parsed_ident_context, parsed_ident_lines, pg_regfree(), PostmasterContext, and tokenize_auth_file().
Referenced by PerformAuthentication(), PostmasterMain(), and SIGHUP_handler().
HbaLine* parse_hba_line | ( | TokenizedAuthLine * | tok_line, |
int | elevel | ||
) |
Definition at line 937 of file hba.c.
References HbaLine::addr, HbaLine::addrlen, addrinfo::ai_addr, addrinfo::ai_addrlen, addrinfo::ai_canonname, addrinfo::ai_family, addrinfo::ai_flags, addrinfo::ai_next, AI_NUMERICHOST, addrinfo::ai_protocol, addrinfo::ai_socktype, Assert(), HbaLine::auth_method, HbaLine::clientcert, clientCertFull, HbaLine::compat_realm, HbaLine::conntype, copy_auth_token(), ctHost, ctHostGSS, ctHostNoGSS, ctHostNoSSL, ctHostSSL, ctLocal, HbaLine::databases, Db_user_namespace, EAI_NONAME, EnableSSL, ereport, TokenizedAuthLine::err_msg, errcode(), errcontext, errhint(), errmsg(), TokenizedAuthLine::fields, gai_strerror, HbaFileName, HbaLine::hostname, HbaLine::include_realm, HbaLine::ip_cmp_method, ipCmpAll, ipCmpMask, ipCmpSameHost, ipCmpSameNet, lappend(), HbaLine::ldapbasedn, HbaLine::ldapbinddn, HbaLine::ldapbindpasswd, HbaLine::ldapprefix, HbaLine::ldapsearchattribute, HbaLine::ldapsearchfilter, HbaLine::ldapserver, HbaLine::ldapsuffix, List::length, lfirst, TokenizedAuthLine::line_num, HbaLine::linenumber, linitial, list_head(), list_length(), lnext(), MANDATORY_AUTH_ARG, HbaLine::mask, HbaLine::masklen, NIL, palloc0(), parse_hba_auth_opt(), pfree(), pg_freeaddrinfo_all(), pg_getaddrinfo_all(), pg_sockaddr_cidr_mask(), psprintf(), pstrdup(), HbaLine::radiusidentifiers, HbaLine::radiusports, HbaLine::radiussecrets, HbaLine::radiusservers, TokenizedAuthLine::raw_line, HbaLine::rawline, HbaLine::roles, generate_unaccent_rules::str, AuthToken::string, token_is_keyword, uaBSD, uaCert, uaGSS, uaIdent, uaLDAP, uaMD5, uaPAM, uaPassword, uaRADIUS, uaReject, uaSCRAM, uaSSPI, uaTrust, HbaLine::upn_username, and val.
Referenced by fill_hba_view(), and load_hba().
IdentLine* parse_ident_line | ( | TokenizedAuthLine * | tok_line, |
int | elevel | ||
) |
Definition at line 2315 of file hba.c.
References Assert(), ereport, TokenizedAuthLine::err_msg, errcode(), errmsg(), TokenizedAuthLine::fields, IDENT_FIELD_ABSENT, IDENT_MULTI_VALUE, IdentLine::ident_user, lfirst, TokenizedAuthLine::line_num, IdentLine::linenumber, linitial, list_head(), lnext(), NIL, palloc(), palloc0(), pfree(), pg_mb2wchar_with_len(), pg_regcomp(), pg_regerror(), IdentLine::pg_role, psprintf(), pstrdup(), IdentLine::re, REG_ADVANCED, AuthToken::string, and IdentLine::usermap.
Referenced by fill_ident_view(), and load_ident().
bool pg_isblank | ( | const char | c | ) |
Definition at line 126 of file hba.c.
Referenced by interpret_ident_response(), and next_token().
MemoryContext tokenize_auth_file | ( | const char * | filename, |
FILE * | file, | ||
List ** | tok_lines, | ||
int | elevel | ||
) |
Definition at line 446 of file hba.c.
References ALLOCSET_SMALL_SIZES, AllocSetContextCreate, buf, CurrentMemoryContext, ereport, TokenizedAuthLine::err_msg, errcode_for_file_access(), errmsg(), TokenizedAuthLine::fields, filename, initStringInfo(), lappend(), TokenizedAuthLine::line_num, MemoryContextSwitchTo(), next_field_expand(), NIL, palloc(), pg_get_line_append(), pg_strip_crlf(), psprintf(), pstrdup(), TokenizedAuthLine::raw_line, resetStringInfo(), and strerror.
Referenced by fill_hba_view(), fill_ident_view(), load_hba(), load_ident(), and tokenize_inc_file().