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

Commite0a09d4

Browse files
committed
Fix inconsistent error handling for GSS encryption in PQconnectPoll()
The error cases for TLS and GSS encryption were inconsistent. After TLSfails, the connection is marked as dead and follow-up calls ofPQconnectPoll() would return immediately, but GSS encryption was notdoing that, so the connection would still have been allowed to enter theGSS handling code. This was handled incorrectly when gssencmode was setto "require". "prefer" was working correctly, and this could not happenunder "disable" as GSS encryption would not be attempted.This commit makes the error handling of GSS encryption on par with TLSportion, fixing the case of gssencmode=require.Reported-by: Jacob ChampionAuthor: Michael PaquierReviewed-by: Jacob Champion, Stephen FrostDiscussion:https://postgr.es/m/23787477-5fe1-a161-6d2a-e459f74c4713@timescale.comBackpatch-through: 12
1 parentbf32ec2 commite0a09d4

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

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

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3148,17 +3148,22 @@ PQconnectPoll(PGconn *conn)
31483148
conn->status=CONNECTION_MADE;
31493149
returnPGRES_POLLING_WRITING;
31503150
}
3151-
elseif (pollres==PGRES_POLLING_FAILED&&
3152-
conn->gssencmode[0]=='p')
3151+
elseif (pollres==PGRES_POLLING_FAILED)
31533152
{
3154-
/*
3155-
* We failed, but we can retry on "prefer". Have to drop
3156-
* the current connection to do so, though.
3157-
*/
3158-
conn->try_gss= false;
3159-
need_new_connection= true;
3160-
gotokeep_going;
3153+
if (conn->gssencmode[0]=='p')
3154+
{
3155+
/*
3156+
* We failed, but we can retry on "prefer". Have to
3157+
* drop the current connection to do so, though.
3158+
*/
3159+
conn->try_gss= false;
3160+
need_new_connection= true;
3161+
gotokeep_going;
3162+
}
3163+
/* Else it's a hard failure */
3164+
gotoerror_return;
31613165
}
3166+
/* Else, return POLLING_READING or POLLING_WRITING status */
31623167
returnpollres;
31633168
#else/* !ENABLE_GSS */
31643169
/* unreachable */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp