diff options
author | Magnus Hagander <magnus@hagander.net> | 2011-05-30 20:11:13 +0200 |
---|---|---|
committer | Magnus Hagander <magnus@hagander.net> | 2011-05-30 20:43:41 +0200 |
commit | 5830f69665053f78cfd31e39f40bb23ad91748a8 (patch) | |
tree | 862c2e2eafdc29026dc6de40359ea36951010448 /src | |
parent | 764bde0f1641cc3aafa2c221c56bd3a8129d9e3b (diff) | |
download | postgresql-5830f69665053f78cfd31e39f40bb23ad91748a8.tar.gz postgresql-5830f69665053f78cfd31e39f40bb23ad91748a8.zip |
Refuse "local" lines in pg_hba.conf on platforms that don't support it
This makes the behavior compatible with that of hostssl, which
also throws an error when there is no SSL support included.
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/libpq/hba.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/backend/libpq/hba.c b/src/backend/libpq/hba.c index c17863fce5f..f3a3b6e2cc1 100644 --- a/src/backend/libpq/hba.c +++ b/src/backend/libpq/hba.c @@ -824,7 +824,16 @@ parse_hba_line(List *line, int line_num, HbaLine *parsedline) token = lfirst(line_item); if (strcmp(token, "local") == 0) { +#ifdef HAVE_UNIX_SOCKETS parsedline->conntype = ctLocal; +#else + ereport(LOG, + (errcode(ERRCODE_CONFIG_FILE_ERROR), + errmsg("local connections are not supported by this build"), + errcontext("line %d of configuration file \"%s\"", + line_num, HbaFileName))); + return false; +#endif } else if (strcmp(token, "host") == 0 || strcmp(token, "hostssl") == 0 |