forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commite3df8f8
committed
Improve authentication error messages.
Most of the improvements were in the new SCRAM code:* In SCRAM protocol violation messages, use errdetail to provide the details.* If pg_backend_random() fails, throw an ERROR rather than just LOG. We shouldn't continue authentication if we can't generate a random nonce.* Use ereport() rather than elog() for the "invalid SCRAM verifier" messages. They shouldn't happen, if everything works, but it's not inconceivable that someone would have invalid scram verifiers in pg_authid, e.g. if a broken client application was used to generate the verifier.But this change applied to old code:* Use ERROR rather than COMMERROR for protocol violation errors. There's no reason to not tell the client what they did wrong. The client might be confused already, so that it cannot read and display the error correctly, but let's at least try. In the "invalid password packet size" case, we used to actually continue with authentication anyway, but that is now a hard error.Patch by Michael Paquier and me. Thanks to Daniel Varrazzo for spottingthe typo in one of the messages that spurred the discussion and theselarger changes.Discussion:https://www.postgresql.org/message-id/CA%2Bmi_8aZYLhuyQi1Jo0hO19opNZ2OEATEOM5fKApH7P6zTOZGg%40mail.gmail.com1 parent7ff9812 commite3df8f8
2 files changed
+44
-37
lines changedLines changed: 38 additions & 28 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
195 | 195 |
| |
196 | 196 |
| |
197 | 197 |
| |
198 |
| - | |
| 198 | + | |
| 199 | + | |
199 | 200 |
| |
200 | 201 |
| |
201 | 202 |
| |
| |||
283 | 284 |
| |
284 | 285 |
| |
285 | 286 |
| |
286 |
| - | |
| 287 | + | |
| 288 | + | |
287 | 289 |
| |
288 | 290 |
| |
289 | 291 |
| |
290 |
| - | |
| 292 | + | |
| 293 | + | |
291 | 294 |
| |
292 | 295 |
| |
293 | 296 |
| |
| |||
319 | 322 |
| |
320 | 323 |
| |
321 | 324 |
| |
322 |
| - | |
| 325 | + | |
| 326 | + | |
323 | 327 |
| |
324 | 328 |
| |
325 | 329 |
| |
| |||
391 | 395 |
| |
392 | 396 |
| |
393 | 397 |
| |
394 |
| - | |
395 |
| - | |
| 398 | + | |
396 | 399 |
| |
397 | 400 |
| |
398 |
| - | |
399 |
| - | |
400 |
| - | |
401 |
| - | |
402 | 401 |
| |
403 | 402 |
| |
404 | 403 |
| |
| |||
435 | 434 |
| |
436 | 435 |
| |
437 | 436 |
| |
438 |
| - | |
| 437 | + | |
| 438 | + | |
439 | 439 |
| |
440 | 440 |
| |
441 | 441 |
| |
442 | 442 |
| |
443 | 443 |
| |
444 | 444 |
| |
445 | 445 |
| |
446 |
| - | |
| 446 | + | |
| 447 | + | |
447 | 448 |
| |
448 | 449 |
| |
449 | 450 |
| |
| |||
582 | 583 |
| |
583 | 584 |
| |
584 | 585 |
| |
585 |
| - | |
586 |
| - | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
587 | 589 |
| |
588 | 590 |
| |
589 | 591 |
| |
590 | 592 |
| |
591 | 593 |
| |
592 |
| - | |
| 594 | + | |
| 595 | + | |
593 | 596 |
| |
594 | 597 |
| |
595 | 598 |
| |
| |||
669 | 672 |
| |
670 | 673 |
| |
671 | 674 |
| |
672 |
| - | |
673 |
| - | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
674 | 678 |
| |
675 | 679 |
| |
676 | 680 |
| |
677 | 681 |
| |
678 | 682 |
| |
679 | 683 |
| |
680 | 684 |
| |
681 |
| - | |
| 685 | + | |
| 686 | + | |
682 | 687 |
| |
683 | 688 |
| |
684 | 689 |
| |
| |||
795 | 800 |
| |
796 | 801 |
| |
797 | 802 |
| |
798 |
| - | |
799 |
| - | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
800 | 806 |
| |
801 | 807 |
| |
802 | 808 |
| |
803 | 809 |
| |
804 |
| - | |
805 |
| - | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
806 | 813 |
| |
807 | 814 |
| |
808 | 815 |
| |
| |||
815 | 822 |
| |
816 | 823 |
| |
817 | 824 |
| |
818 |
| - | |
819 |
| - | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
820 | 828 |
| |
821 | 829 |
| |
822 | 830 |
| |
| |||
831 | 839 |
| |
832 | 840 |
| |
833 | 841 |
| |
834 |
| - | |
| 842 | + | |
835 | 843 |
| |
836 | 844 |
| |
837 | 845 |
| |
| |||
960 | 968 |
| |
961 | 969 |
| |
962 | 970 |
| |
963 |
| - | |
| 971 | + | |
964 | 972 |
| |
965 | 973 |
| |
966 | 974 |
| |
| |||
1044 | 1052 |
| |
1045 | 1053 |
| |
1046 | 1054 |
| |
1047 |
| - | |
| 1055 | + | |
| 1056 | + | |
1048 | 1057 |
| |
1049 | 1058 |
| |
1050 | 1059 |
| |
1051 | 1060 |
| |
1052 | 1061 |
| |
1053 | 1062 |
| |
1054 |
| - | |
| 1063 | + | |
| 1064 | + | |
1055 | 1065 |
| |
1056 | 1066 |
| |
1057 | 1067 |
| |
|
Lines changed: 6 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
656 | 656 |
| |
657 | 657 |
| |
658 | 658 |
| |
659 |
| - | |
| 659 | + | |
660 | 660 |
| |
661 | 661 |
| |
662 | 662 |
| |
| |||
684 | 684 |
| |
685 | 685 |
| |
686 | 686 |
| |
687 |
| - | |
| 687 | + | |
688 | 688 |
| |
689 | 689 |
| |
690 | 690 |
| |
| |||
897 | 897 |
| |
898 | 898 |
| |
899 | 899 |
| |
900 |
| - | |
| 900 | + | |
901 | 901 |
| |
902 | 902 |
| |
903 | 903 |
| |
904 |
| - | |
905 | 904 |
| |
906 | 905 |
| |
907 | 906 |
| |
| |||
935 | 934 |
| |
936 | 935 |
| |
937 | 936 |
| |
938 |
| - | |
| 937 | + | |
939 | 938 |
| |
940 | 939 |
| |
941 |
| - | |
942 |
| - | |
943 | 940 |
| |
944 | 941 |
| |
945 | 942 |
| |
| |||
1144 | 1141 |
| |
1145 | 1142 |
| |
1146 | 1143 |
| |
1147 |
| - | |
| 1144 | + | |
1148 | 1145 |
| |
1149 | 1146 |
| |
1150 | 1147 |
| |
| |||
1384 | 1381 |
| |
1385 | 1382 |
| |
1386 | 1383 |
| |
1387 |
| - | |
| 1384 | + | |
1388 | 1385 |
| |
1389 | 1386 |
| |
1390 | 1387 |
| |
|
0 commit comments
Comments
(0)