postgresql/src/backend
Heikki Linnakangas e3df8f8b93 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 spotting
the typo in one of the messages that spurred the discussion and these
larger changes.

Discussion: https://www.postgresql.org/message-id/CA%2Bmi_8aZYLhuyQi1Jo0hO19opNZ2OEATEOM5fKApH7P6zTOZGg%40mail.gmail.com
2017-06-08 19:54:22 +03:00
..
access Clean up latch related code. 2017-06-06 16:13:00 -07:00
bootstrap Disallow CREATE INDEX if table is already in use in current session. 2017-06-04 12:02:41 -04:00
catalog Fix updating of pg_subscription_rel from workers 2017-06-07 13:49:14 -04:00
commands Fix updating of pg_subscription_rel from workers 2017-06-07 13:49:14 -04:00
executor Prevent BEFORE triggers from violating partitioning constraints. 2017-06-07 12:50:45 -04:00
foreign Abstract logic to allow for multiple kinds of child rels. 2017-04-03 22:41:31 -04:00
lib Post-PG 10 beta1 pgindent run 2017-05-17 16:31:56 -04:00
libpq Improve authentication error messages. 2017-06-08 19:54:22 +03:00
main Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
nodes Fix omission of locations in outfuncs/readfuncs partitioning node support. 2017-05-30 11:32:41 -04:00
optimizer #ifdef out assorted unused GEQO code. 2017-06-04 13:34:05 -04:00
parser Fix ALTER SUBSCRIPTION grammar ambiguity 2017-06-05 21:43:25 -04:00
po Translation updates 2017-05-15 12:19:54 -04:00
port Post-PG 10 beta1 pgindent run 2017-05-17 16:31:56 -04:00
postmaster Clean up latch related code. 2017-06-06 16:13:00 -07:00
regex Fix regexport.c to behave sanely with lookaround constraints. 2017-04-13 17:18:35 -04:00
replication Fix updating of pg_subscription_rel from workers 2017-06-07 13:49:14 -04:00
rewrite Post-PG 10 beta1 pgindent run 2017-05-17 16:31:56 -04:00
snowball Add ICU_FLAGS to one more place 2017-03-23 16:53:10 -04:00
statistics Post-PG 10 beta1 pgindent run 2017-05-17 16:31:56 -04:00
storage Clean up latch related code. 2017-06-06 16:13:00 -07:00
tcop Unify SIGHUP handling between normal and walsender backends. 2017-06-05 19:18:16 -07:00
tsearch Post-PG 10 beta1 pgindent run 2017-05-17 16:31:56 -04:00
utils Use NIL rather than NULL to represent an empty list. 2017-06-06 11:21:22 -04:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
Makefile Implement multivariate n-distinct coefficients 2017-03-24 14:06:10 -03:00
common.mk ICU support 2017-03-23 15:28:48 -04:00
nls.mk Translation updates 2017-05-15 12:19:54 -04:00