forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitad6c528
committed
Add error context callback when tokenizing authentication files
The parsing of the authentication files for HBA and ident entrieshappens in two phases:- Tokenization of the files, creating a list of TokenizedAuthLines.- Validation of the HBA and ident entries, building a set of HbaLines orIdentLines.The second phase doing the validation provides already some errorcontext about the configuration file and the line where a problemhappens, but there is no such information in the first phase whentokenizing the files. This commit adds an ErrorContextCallback intokenize_auth_file(), with a context made of the line number and theconfiguration file name involved in a problem. This is useful for filesincluded in an HBA file for user and database lists, and it will becomemuch more handy to track problems for files included via a potential@include[_dir,_if_exists].The error context is registered so as the full chain of events isreported when using cascaded inclusions when for exampletokenize_auth_file() recurses over itself on new files, displaying onecontext line for each file gone through when tokenizing things.Author: Michael PaquierReviewed-by: Julien RouhaudDiscussion:https://postgr.es/m/Y2xUBJ+S+Z0zbxRW@paquier.xyz1 parent783e8c6 commitad6c528
2 files changed
+32
-0
lines changedLines changed: 31 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
66 | 66 |
| |
67 | 67 |
| |
68 | 68 |
| |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
69 | 74 |
| |
70 | 75 |
| |
71 | 76 |
| |
| |||
125 | 130 |
| |
126 | 131 |
| |
127 | 132 |
| |
| 133 | + | |
128 | 134 |
| |
129 | 135 |
| |
130 | 136 |
| |
| |||
570 | 576 |
| |
571 | 577 |
| |
572 | 578 |
| |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
573 | 591 |
| |
574 | 592 |
| |
575 | 593 |
| |
| |||
598 | 616 |
| |
599 | 617 |
| |
600 | 618 |
| |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
601 | 629 |
| |
602 | 630 |
| |
603 | 631 |
| |
| |||
686 | 714 |
| |
687 | 715 |
| |
688 | 716 |
| |
| 717 | + | |
689 | 718 |
| |
690 | 719 |
| |
691 | 720 |
| |
692 | 721 |
| |
| 722 | + | |
| 723 | + | |
693 | 724 |
| |
694 | 725 |
| |
695 | 726 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3723 | 3723 |
| |
3724 | 3724 |
| |
3725 | 3725 |
| |
| 3726 | + | |
3726 | 3727 |
| |
3727 | 3728 |
| |
3728 | 3729 |
| |
|
0 commit comments
Comments
(0)