Skip to content

Commit a2e9de7

Browse files
committed
Log a warning instead of shutting down the system if we can't load
pg_hba.conf on reload (for example due to a permission error). Selena Deckelmann
1 parent fd75329 commit a2e9de7

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/backend/libpq/hba.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
*
1212
* IDENTIFICATION
13-
* $PostgreSQL: pgsql/src/backend/libpq/hba.c,v 1.180 2009/01/07 13:09:21 mha Exp $
13+
* $PostgreSQL: pgsql/src/backend/libpq/hba.c,v 1.181 2009/03/04 08:43:15 mha Exp $
1414
*
1515
*-------------------------------------------------------------------------
1616
*/
@@ -1306,12 +1306,19 @@ load_hba(void)
13061306
List *new_parsed_lines = NIL;
13071307

13081308
file = AllocateFile(HbaFileName, "r");
1309-
/* Failure is fatal since with no HBA entries we can do nothing... */
13101309
if (file == NULL)
1311-
ereport(FATAL,
1310+
{
1311+
ereport(WARNING,
13121312
(errcode_for_file_access(),
13131313
errmsg("could not open configuration file \"%s\": %m",
13141314
HbaFileName)));
1315+
/*
1316+
* Caller will take care of making this a FATAL error in case this is
1317+
* the initial startup. If it happens on reload, we just keep the
1318+
* old version around.
1319+
*/
1320+
return false;
1321+
}
13151322

13161323
tokenize_file(HbaFileName, file, &hba_lines, &hba_line_nums);
13171324
FreeFile(file);

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