forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit783e8c6
committed
Invent open_auth_file() in hba.c to refactor authentication file opening
This adds a check on the recursion depth when including authenticationconfiguration files, something that has never been done when processing'@' files for database and user name lists in pg_hba.conf. On HEAD,this was leading to a rather confusing error, as of:FATAL: exceeded maxAllocatedDescs (NN) while trying to open file "/path/blah.conf"This refactors the code so as the error reported is now the following,which is the same as for GUCs:FATAL: could not open file "/path/blah.conf": maximum nesting depth exceededThis reduces a bit the verbosity of the error message used for filesincluded in user and database lists, reporting only the file name ofwhat's failing to load, without mentioning the relative or absolute pathspecified after '@' in a HBA file. The absolute path is built upon what'@' defines anyway, so there is no actual loss of information. Thismakes the future inclusion logic much simpler. A follow-up patch willadd an error context to be able to track on which line of which file theinclusion is failing, to close the loop, providing all the informationneeded to know the full chain of events.This logic has been extracted from a larger patch written by Julien,rewritten by me to have a unique code path calling AllocateFile() onauthentication files, and is useful on its own. This new interfacewill be used later for authentication files included with@include[_dir,_if_exists], in a follow-up patch.Author: Michael Paquier, Julien RouhaudDiscussion:https://www.postgresql.org/message-id/Y2xUBJ+S+Z0zbxRW@paquier.xyz1 parent45d5eca commit783e8c6
File tree
3 files changed
+81
-45
lines changed- src
- backend
- libpq
- utils/adt
- include/libpq
3 files changed
+81
-45
lines changedLines changed: 72 additions & 28 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
117 | 117 |
| |
118 | 118 |
| |
119 | 119 |
| |
120 |
| - | |
| 120 | + | |
| 121 | + | |
121 | 122 |
| |
122 | 123 |
| |
123 | 124 |
| |
| |||
414 | 415 |
| |
415 | 416 |
| |
416 | 417 |
| |
417 |
| - | |
| 418 | + | |
418 | 419 |
| |
419 | 420 |
| |
420 | 421 |
| |
| |||
431 | 432 |
| |
432 | 433 |
| |
433 | 434 |
| |
434 |
| - | |
| 435 | + | |
435 | 436 |
| |
436 | 437 |
| |
437 | 438 |
| |
| |||
459 | 460 |
| |
460 | 461 |
| |
461 | 462 |
| |
| 463 | + | |
462 | 464 |
| |
463 | 465 |
| |
464 | 466 |
| |
| |||
468 | 470 |
| |
469 | 471 |
| |
470 | 472 |
| |
| 473 | + | |
471 | 474 |
| |
472 |
| - | |
473 | 475 |
| |
474 | 476 |
| |
475 |
| - | |
476 |
| - | |
477 |
| - | |
478 |
| - | |
479 |
| - | |
480 |
| - | |
481 |
| - | |
482 |
| - | |
| 477 | + | |
483 | 478 |
| |
484 | 479 |
| |
485 | 480 |
| |
486 | 481 |
| |
487 | 482 |
| |
488 |
| - | |
| 483 | + | |
| 484 | + | |
489 | 485 |
| |
490 | 486 |
| |
491 | 487 |
| |
| |||
521 | 517 |
| |
522 | 518 |
| |
523 | 519 |
| |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
524 | 573 |
| |
525 | 574 |
| |
526 | 575 |
| |
| |||
532 | 581 |
| |
533 | 582 |
| |
534 | 583 |
| |
| 584 | + | |
535 | 585 |
| |
536 | 586 |
| |
537 | 587 |
| |
| |||
542 | 592 |
| |
543 | 593 |
| |
544 | 594 |
| |
545 |
| - | |
| 595 | + | |
546 | 596 |
| |
547 | 597 |
| |
548 | 598 |
| |
| |||
613 | 663 |
| |
614 | 664 |
| |
615 | 665 |
| |
616 |
| - | |
| 666 | + | |
617 | 667 |
| |
618 | 668 |
| |
619 | 669 |
| |
| |||
2332 | 2382 |
| |
2333 | 2383 |
| |
2334 | 2384 |
| |
2335 |
| - | |
| 2385 | + | |
2336 | 2386 |
| |
2337 | 2387 |
| |
2338 |
| - | |
2339 |
| - | |
2340 |
| - | |
2341 |
| - | |
| 2388 | + | |
2342 | 2389 |
| |
2343 | 2390 |
| |
2344 | 2391 |
| |
2345 |
| - | |
| 2392 | + | |
2346 | 2393 |
| |
2347 | 2394 |
| |
2348 | 2395 |
| |
| |||
2703 | 2750 |
| |
2704 | 2751 |
| |
2705 | 2752 |
| |
2706 |
| - | |
| 2753 | + | |
| 2754 | + | |
2707 | 2755 |
| |
2708 | 2756 |
| |
2709 |
| - | |
2710 |
| - | |
2711 |
| - | |
2712 |
| - | |
2713 |
| - | |
| 2757 | + | |
2714 | 2758 |
| |
2715 | 2759 |
| |
2716 | 2760 |
| |
2717 |
| - | |
| 2761 | + | |
2718 | 2762 |
| |
2719 | 2763 |
| |
2720 | 2764 |
| |
|
Lines changed: 6 additions & 16 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
380 | 380 |
| |
381 | 381 |
| |
382 | 382 |
| |
383 |
| - | |
384 |
| - | |
385 |
| - | |
386 |
| - | |
387 |
| - | |
388 |
| - | |
389 |
| - | |
390 |
| - | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
391 | 386 |
| |
392 | 387 |
| |
393 | 388 |
| |
| |||
529 | 524 |
| |
530 | 525 |
| |
531 | 526 |
| |
532 |
| - | |
533 |
| - | |
534 |
| - | |
535 |
| - | |
536 |
| - | |
537 |
| - | |
538 |
| - | |
539 |
| - | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
540 | 530 |
| |
541 | 531 |
| |
542 | 532 |
| |
|
Lines changed: 3 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
177 | 177 |
| |
178 | 178 |
| |
179 | 179 |
| |
| 180 | + | |
| 181 | + | |
180 | 182 |
| |
181 |
| - | |
| 183 | + | |
182 | 184 |
| |
183 | 185 |
|
0 commit comments
Comments
(0)