29 int lineno,
HbaLine *hba,
const char *err_msg);
32 int lineno,
IdentLine *ident,
const char *err_msg);
44 #define MAX_HBA_OPTIONS 14
160 #define NUM_PG_HBA_FILE_RULES_ATTS 9
177 int lineno,
HbaLine *hba,
const char *err_msg)
193 memset(nulls, 0,
sizeof(nulls));
216 typestr =
"hostnossl";
219 typestr =
"hostgssenc";
222 typestr =
"hostnogssenc";
228 nulls[
index++] =
true;
252 nulls[
index++] =
true;
260 foreach(lc, hba->
roles)
269 nulls[
index++] =
true;
273 addrstr = maskstr = NULL;
290 buffer,
sizeof(buffer),
299 buffer,
sizeof(buffer),
311 addrstr =
"samehost";
320 nulls[
index++] =
true;
324 nulls[
index++] =
true;
334 nulls[
index++] =
true;
376 errmsg(
"could not open configuration file \"%s\": %m",
384 "hba parser context",
387 foreach(line, hba_lines)
434 #define NUM_PG_IDENT_FILE_MAPPINGS_ATTS 5
451 int lineno,
IdentLine *ident,
const char *err_msg)
461 memset(nulls, 0,
sizeof(nulls));
512 errmsg(
"could not open usermap file \"%s\": %m",
520 "ident parser context",
523 foreach(line, ident_lines)
ArrayType * construct_array(Datum *elems, int nelems, Oid elmtype, int elmlen, bool elmbyval, char elmalign)
static Datum values[MAXATTR]
#define CStringGetTextDatum(s)
int errcode_for_file_access(void)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
FILE * AllocateFile(const char *name, const char *mode)
void SetSingleFuncCall(FunctionCallInfo fcinfo, bits32 flags)
IdentLine * parse_ident_line(TokenizedAuthLine *tok_line, int elevel)
const char * hba_authname(UserAuth auth_method)
HbaLine * parse_hba_line(TokenizedAuthLine *tok_line, int elevel)
MemoryContext tokenize_auth_file(const char *filename, FILE *file, List **tok_lines, int elevel)
static void fill_hba_view(Tuplestorestate *tuple_store, TupleDesc tupdesc)
static void fill_ident_view(Tuplestorestate *tuple_store, TupleDesc tupdesc)
#define NUM_PG_HBA_FILE_RULES_ATTS
static void fill_hba_line(Tuplestorestate *tuple_store, TupleDesc tupdesc, int lineno, HbaLine *hba, const char *err_msg)
static ArrayType * get_hba_options(HbaLine *hba)
Datum pg_ident_file_mappings(PG_FUNCTION_ARGS)
#define NUM_PG_IDENT_FILE_MAPPINGS_ATTS
static void fill_ident_line(Tuplestorestate *tuple_store, TupleDesc tupdesc, int lineno, IdentLine *ident, const char *err_msg)
Datum pg_hba_file_rules(PG_FUNCTION_ARGS)
HeapTuple heap_form_tuple(TupleDesc tupleDescriptor, Datum *values, bool *isnull)
int pg_getnameinfo_all(const struct sockaddr_storage *addr, int salen, char *node, int nodelen, char *service, int servicelen, int flags)
Assert(fmt[strlen(fmt) - 1] !='\n')
List * lappend(List *list, void *datum)
char * pstrdup(const char *in)
MemoryContext CurrentMemoryContext
void MemoryContextDelete(MemoryContext context)
#define AllocSetContextCreate
#define ALLOCSET_SMALL_SIZES
void clean_ipv6_addr(int addr_family, char *addr)
ArrayType * strlist_to_textarray(List *list)
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
#define PointerGetDatum(X)
char * psprintf(const char *fmt,...)
struct sockaddr_storage mask
ClientCertMode clientcert
char * ldapsearchattribute
struct sockaddr_storage addr
IPCompareMethod ip_cmp_method
char * radiusidentifiers_s
Tuplestorestate * setResult
void tuplestore_puttuple(Tuplestorestate *state, HeapTuple tuple)