forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit771e127
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 parentc900960 commit771e127
2 files changed
+63
-4
lines changedLines changed: 58 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
565 | 565 |
| |
566 | 566 |
| |
567 | 567 |
| |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
568 | 584 |
| |
569 | 585 |
| |
570 | 586 |
| |
| |||
583 | 599 |
| |
584 | 600 |
| |
585 | 601 |
| |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
586 | 622 |
| |
587 | 623 |
| |
588 | 624 |
| |
| |||
931 | 967 |
| |
932 | 968 |
| |
933 | 969 |
| |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
934 | 992 |
| |
935 | 993 |
| |
936 | 994 |
| |
|
Lines changed: 5 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
645 | 645 |
| |
646 | 646 |
| |
647 | 647 |
| |
648 |
| - | |
| 648 | + | |
| 649 | + | |
649 | 650 |
| |
650 |
| - | |
| 651 | + | |
651 | 652 |
| |
652 |
| - | |
653 |
| - | |
| 653 | + | |
| 654 | + | |
654 | 655 |
| |
655 | 656 |
| |
656 | 657 |
| |
|
0 commit comments
Comments
(0)