forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit6e42130
committed
Reject empty names and recursion in config-file include directives.
An empty file name or subdirectory name leads join_path_components() tojust produce the parent directory name, which leads to weird failures orrecursive inclusions. Let's throw a specific error for that. It takesonly slightly more code to detect all-blank names, so do so.Also, detect direct recursion, ie a file calling itself. As codedthis will also detect recursion via "include_dir '.'", which isperhaps more likely than explicitly including the file itself.Detecting indirect recursion would require API changes for guc-file.lfunctions, which seems not worth it since extensions might call them.The nesting depth limit will catch such cases eventually, just notwith such an on-point error message.In passing, adjust the example usages in postgresql.conf.sampleto perhaps eliminate the problem at the source: there's no reasonfor the examples to suggest that an empty value is valid.Per a trouble report from Brent Bates. Back-patch to 9.5; theissue is old, but the code in 9.4 is enough different that thepatch doesn't apply easily, and it doesn't seem worth the troubleto fix there.Ian Barwick and Tom LaneDiscussion:https://postgr.es/m/8c8bcbca-3bd9-dc6e-8986-04a5abdef142@2ndquadrant.com1 parent9acda73 commit6e42130
2 files changed
+63
-4
lines changedLines changed: 58 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
567 | 567 |
| |
568 | 568 |
| |
569 | 569 |
| |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
570 | 586 |
| |
571 | 587 |
| |
572 | 588 |
| |
| |||
585 | 601 |
| |
586 | 602 |
| |
587 | 603 |
| |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
588 | 624 |
| |
589 | 625 |
| |
590 | 626 |
| |
| |||
933 | 969 |
| |
934 | 970 |
| |
935 | 971 |
| |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
936 | 994 |
| |
937 | 995 |
| |
938 | 996 |
| |
|
Lines changed: 5 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
734 | 734 |
| |
735 | 735 |
| |
736 | 736 |
| |
737 |
| - | |
| 737 | + | |
| 738 | + | |
738 | 739 |
| |
739 |
| - | |
| 740 | + | |
740 | 741 |
| |
741 |
| - | |
742 |
| - | |
| 742 | + | |
| 743 | + | |
743 | 744 |
| |
744 | 745 |
| |
745 | 746 |
| |
|
0 commit comments
Comments
(0)