PostgreSQL Source Code
git master
|
Go to the source code of this file.
Data Structures | |
struct | AuthToken |
struct | HbaLine |
struct | IdentLine |
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 AuthToken | AuthToken |
typedef struct HbaLine | HbaLine |
typedef struct IdentLine | IdentLine |
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 , uaPeer } |
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_user, const char *system_user, bool case_insensitive) |
HbaLine * | parse_hba_line (TokenizedAuthLine *tok_line, int elevel) |
IdentLine * | parse_ident_line (TokenizedAuthLine *tok_line, int elevel) |
bool | pg_isblank (const char c) |
FILE * | open_auth_file (const char *filename, int elevel, int depth, char **err_msg) |
void | free_auth_file (FILE *file, int depth) |
void | tokenize_auth_file (const char *filename, FILE *file, List **tok_lines, int elevel, int depth) |
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_user, | ||
const char * | system_user, | ||
bool | case_insensitive | ||
) |
Definition at line 2908 of file hba.c.
References check_ident_usermap(), ereport, errmsg(), error(), lfirst, LOG, parsed_ident_lines, pg_strcasecmp(), STATUS_ERROR, STATUS_OK, and system_user().
Referenced by auth_peer(), and ident_inet().
void free_auth_file | ( | FILE * | file, |
int | depth | ||
) |
Definition at line 570 of file hba.c.
References CONF_FILE_START_DEPTH, FreeFile(), MemoryContextDelete(), and tokenize_context.
Referenced by fill_hba_view(), fill_ident_view(), load_hba(), load_ident(), tokenize_expand_file(), and tokenize_include_file().
const char* hba_authname | ( | UserAuth | auth_method | ) |
Definition at line 3065 of file hba.c.
References UserAuthName.
Referenced by ClientAuthentication(), fill_hba_line(), InitPostgres(), ParallelWorkerMain(), and set_authn_id().
void hba_getauthmethod | ( | hbaPort * | port | ) |
Definition at line 3052 of file hba.c.
References check_hba(), and port.
Referenced by ClientAuthentication().
bool load_hba | ( | void | ) |
Definition at line 2587 of file hba.c.
References ALLOCSET_SMALL_SIZES, AllocSetContextCreate, Assert, ereport, TokenizedAuthLine::err_msg, errcode(), errmsg(), free_auth_file(), HbaFileName, lappend(), lfirst, LOG, MemoryContextDelete(), MemoryContextSwitchTo(), newline, NIL, open_auth_file(), parse_hba_line(), parsed_hba_context, parsed_hba_lines, PostmasterContext, and tokenize_auth_file().
Referenced by PerformAuthentication(), PostmasterMain(), and process_pm_reload_request().
bool load_ident | ( | void | ) |
Definition at line 2963 of file hba.c.
References ALLOCSET_SMALL_SIZES, AllocSetContextCreate, Assert, TokenizedAuthLine::err_msg, free_auth_file(), IdentFileName, lappend(), lfirst, LOG, MemoryContextDelete(), MemoryContextSwitchTo(), newline, NIL, open_auth_file(), parse_ident_line(), parsed_ident_context, parsed_ident_lines, PostmasterContext, and tokenize_auth_file().
Referenced by PerformAuthentication(), PostmasterMain(), and process_pm_reload_request().
FILE* open_auth_file | ( | const char * | filename, |
int | elevel, | ||
int | depth, | ||
char ** | err_msg | ||
) |
Definition at line 595 of file hba.c.
References AllocateFile(), ALLOCSET_START_SMALL_SIZES, AllocSetContextCreate, CONF_FILE_MAX_DEPTH, CONF_FILE_START_DEPTH, CurrentMemoryContext, ereport, errcode_for_file_access(), errmsg(), filename, psprintf(), and tokenize_context.
Referenced by fill_hba_view(), fill_ident_view(), load_hba(), load_ident(), tokenize_expand_file(), and tokenize_include_file().
HbaLine* parse_hba_line | ( | TokenizedAuthLine * | tok_line, |
int | elevel | ||
) |
Definition at line 1326 of file hba.c.
References HbaLine::addr, HbaLine::addrlen, Assert, HbaLine::auth_method, HbaLine::clientcert, clientCertFull, HbaLine::compat_realm, HbaLine::conntype, copy_auth_token(), ctHost, ctHostGSS, ctHostNoGSS, ctHostNoSSL, ctHostSSL, ctLocal, HbaLine::databases, EnableSSL, ereport, TokenizedAuthLine::err_msg, errcode(), errcontext, errhint(), errmsg(), TokenizedAuthLine::fields, TokenizedAuthLine::file_name, gai_strerror(), 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, regcomp_auth_token(), HbaLine::roles, HbaLine::sourcefile, str, token, token_is_keyword, uaBSD, uaCert, uaGSS, uaIdent, uaLDAP, uaMD5, uaPAM, uaPassword, uaPeer, 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 2693 of file hba.c.
References Assert, copy_auth_token(), TokenizedAuthLine::err_msg, TokenizedAuthLine::fields, TokenizedAuthLine::file_name, IDENT_FIELD_ABSENT, IDENT_MULTI_VALUE, lfirst, TokenizedAuthLine::line_num, IdentLine::linenumber, linitial, list_head(), lnext(), NIL, palloc0(), IdentLine::pg_user, pstrdup(), regcomp_auth_token(), IdentLine::system_user, token, and IdentLine::usermap.
Referenced by fill_ident_view(), and load_ident().
bool pg_isblank | ( | const char | c | ) |
Definition at line 144 of file hba.c.
Referenced by interpret_ident_response(), and next_token().
void tokenize_auth_file | ( | const char * | filename, |
FILE * | file, | ||
List ** | tok_lines, | ||
int | elevel, | ||
int | depth | ||
) |
Definition at line 689 of file hba.c.
References ALLOCSET_SMALL_SIZES, AllocSetContextCreate, appendStringInfoChar(), appendStringInfoString(), ErrorContextCallback::arg, Assert, buf, ErrorContextCallback::callback, CONF_FILE_START_DEPTH, CurrentMemoryContext, StringInfoData::data, ereport, TokenizedAuthLine::err_msg, errcode_for_file_access(), errmsg(), error_context_stack, TokenizedAuthLine::fields, TokenizedAuthLine::file_name, tokenize_error_callback_arg::filename, filename, GetConfFilesInDir(), i, initStringInfo(), lappend(), StringInfoData::len, TokenizedAuthLine::line_num, tokenize_error_callback_arg::linenum, linitial, linitial_node, list_length(), lsecond_node, MemoryContextDelete(), MemoryContextSwitchTo(), next_field_expand(), NIL, palloc0(), pfree(), pg_get_line_append(), pg_strip_crlf(), ErrorContextCallback::previous, psprintf(), pstrdup(), TokenizedAuthLine::raw_line, resetStringInfo(), AuthToken::string, tokenize_context, tokenize_error_callback(), and tokenize_include_file().
Referenced by fill_hba_view(), fill_ident_view(), load_hba(), load_ident(), tokenize_expand_file(), and tokenize_include_file().