|
10 | 10 | *
|
11 | 11 | *
|
12 | 12 | * IDENTIFICATION
|
13 |
| - * $PostgreSQL: pgsql/src/backend/libpq/hba.c,v 1.182 2009/03/04 18:43:38 mha Exp $ |
| 13 | + * $PostgreSQL: pgsql/src/backend/libpq/hba.c,v 1.183 2009/03/07 21:28:00 mha Exp $ |
14 | 14 | *
|
15 | 15 | *-------------------------------------------------------------------------
|
16 | 16 | */
|
@@ -1304,6 +1304,7 @@ load_hba(void)
|
1304 | 1304 | List*hba_line_nums=NIL;
|
1305 | 1305 | ListCell*line,*line_num;
|
1306 | 1306 | List*new_parsed_lines=NIL;
|
| 1307 | +boolok= true; |
1307 | 1308 |
|
1308 | 1309 | file=AllocateFile(HbaFileName,"r");
|
1309 | 1310 | if (file==NULL)
|
@@ -1332,17 +1333,29 @@ load_hba(void)
|
1332 | 1333 |
|
1333 | 1334 | if (!parse_hba_line(lfirst(line),lfirst_int(line_num),newline))
|
1334 | 1335 | {
|
1335 |
| -/* Parse error in the file, sobail out */ |
| 1336 | +/* Parse error in the file, soindicate there's a problem */ |
1336 | 1337 | free_hba_record(newline);
|
1337 | 1338 | pfree(newline);
|
1338 |
| -clean_hba_list(new_parsed_lines); |
1339 |
| -/* Error has already been reported in the parsing function */ |
1340 |
| -return false; |
| 1339 | + |
| 1340 | +/* |
| 1341 | + * Keep parsing the rest of the file so we can report errors |
| 1342 | + * on more than the first row. Error has already been reported |
| 1343 | + * in the parsing function, so no need to log it here. |
| 1344 | + */ |
| 1345 | +ok= false; |
| 1346 | +continue; |
1341 | 1347 | }
|
1342 | 1348 |
|
1343 | 1349 | new_parsed_lines=lappend(new_parsed_lines,newline);
|
1344 | 1350 | }
|
1345 | 1351 |
|
| 1352 | +if (!ok) |
| 1353 | +{ |
| 1354 | +/* Parsing failed at one or more rows, so bail out */ |
| 1355 | +clean_hba_list(new_parsed_lines); |
| 1356 | +return false; |
| 1357 | +} |
| 1358 | + |
1346 | 1359 | /* Loaded new file successfully, replace the one we use */
|
1347 | 1360 | clean_hba_list(parsed_hba_lines);
|
1348 | 1361 | parsed_hba_lines=new_parsed_lines;
|
|