Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdb73b28

Browse files
committed
Give nicer error message when connecting to a v10 server requiring SCRAM.
This is just to give the user a hint that they need to upgrade, if they tryto connect to a v10 server that uses SCRAM authentication, with an olderclient.Commit to all stable branches, but not master.Discussion:https://www.postgresql.org/message-id/bbf45d92-3896-eeb7-7399-2111d517261b@pivotal.io
1 parent6e86b44 commitdb73b28

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

‎src/include/libpq/pqcomm.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,8 @@ extern bool Db_user_namespace;
172172
#defineAUTH_REQ_GSS7/* GSSAPI without wrap() */
173173
#defineAUTH_REQ_GSS_CONT8/* Continue GSS exchanges */
174174
#defineAUTH_REQ_SSPI9/* SSPI negotiate without wrap() */
175+
#defineAUTH_REQ_SASL 10/* SASL authentication. Not supported before
176+
* libpq version 10. */
175177

176178
typedefuint32AuthRequest;
177179

‎src/interfaces/libpq/fe-auth.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -961,6 +961,19 @@ pg_fe_sendauth(AuthRequest areq, PGconn *conn)
961961
returnSTATUS_ERROR;
962962
break;
963963

964+
/*
965+
* SASL authentication was introduced in version 10. Older
966+
* versions recognize the request only to give a nicer error
967+
* message. We call it "SCRAM authentication" in the error, rather
968+
* than SASL, because SCRAM is more familiar to users, and it's
969+
* the only SASL authentication mechanism that has been
970+
* implemented as of this writing, anyway.
971+
*/
972+
caseAUTH_REQ_SASL:
973+
printfPQExpBuffer(&conn->errorMessage,
974+
libpq_gettext("SCRAM authentication requires libpq version 10 or above\n"));
975+
returnSTATUS_ERROR;
976+
964977
default:
965978
printfPQExpBuffer(&conn->errorMessage,
966979
libpq_gettext("authentication method %u not supported\n"),areq);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp