Skip to content

Commit 5830f69

Browse files
committed
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.
1 parent 764bde0 commit 5830f69

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/backend/libpq/hba.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -824,7 +824,16 @@ parse_hba_line(List *line, int line_num, HbaLine *parsedline)
824824
token = lfirst(line_item);
825825
if (strcmp(token, "local") == 0)
826826
{
827+
#ifdef HAVE_UNIX_SOCKETS
827828
parsedline->conntype = ctLocal;
829+
#else
830+
ereport(LOG,
831+
(errcode(ERRCODE_CONFIG_FILE_ERROR),
832+
errmsg("local connections are not supported by this build"),
833+
errcontext("line %d of configuration file \"%s\"",
834+
line_num, HbaFileName)));
835+
return false;
836+
#endif
828837
}
829838
else if (strcmp(token, "host") == 0
830839
|| strcmp(token, "hostssl") == 0

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy