- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit9837be9
committed
Produce a more useful error message for over-length Unix socket paths.
The length of a socket path name is constrained by the size of structsockaddr_un, and there's not a lot we can do about it since that is akernel API. However, it would be a good thing if we produced anintelligible error message when the user specifies a socket path that's toolong --- and getaddrinfo's standard API is too impoverished to do this inthe natural way. So insert explicit tests at the places where we constructa socket path name. Now you'll get an error that makes sense and eventells you what the limit is, rather than something generic like"Non-recoverable failure in name resolution".Per trouble report from Jeremy Drake and a fix idea from Andrew Dunstan.1 parent5c8c7c7 commit9837be9
File tree
3 files changed
+31
-1
lines changed- src
- backend/libpq
- include/libpq
- interfaces/libpq
3 files changed
+31
-1
lines changedLines changed: 8 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
476 | 476 |
| |
477 | 477 |
| |
478 | 478 |
| |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
479 | 487 |
| |
480 | 488 |
| |
481 | 489 |
| |
|
Lines changed: 13 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
73 | 73 |
| |
74 | 74 |
| |
75 | 75 |
| |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
76 | 89 |
| |
77 | 90 |
| |
78 | 91 |
| |
|
Lines changed: 10 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
765 | 765 |
| |
766 | 766 |
| |
767 | 767 |
| |
768 |
| - | |
| 768 | + | |
769 | 769 |
| |
770 | 770 |
| |
771 | 771 |
| |
| |||
817 | 817 |
| |
818 | 818 |
| |
819 | 819 |
| |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
820 | 829 |
| |
821 | 830 |
| |
822 | 831 |
| |
|
0 commit comments
Comments
(0)