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

Commitd662e39

Browse files
committed
Fix SSPI login when multiple roundtrips are required
This fixes SSPI login failures showing "The functionrequested is not supported", often showing up when connectingto localhost. The reason was not properly updating the SSPIhandle when multiple roundtrips were required to complete theauthentication sequence.Report and analysis by Ahmed Shinwari, patch by Magnus Hagander
1 parent75f386d commitd662e39

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

‎src/backend/libpq/auth.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1366,16 +1366,22 @@ pg_SSPI_recvauth(Port *port)
13661366
_("could not accept SSPI security context"),r);
13671367
}
13681368

1369+
/*
1370+
* Overwrite the current context with the one we just received.
1371+
* If sspictx is NULL it was the first loop and we need to allocate
1372+
* a buffer for it. On subsequent runs, we can just overwrite the
1373+
* buffer contents since the size does not change.
1374+
*/
13691375
if (sspictx==NULL)
13701376
{
13711377
sspictx=malloc(sizeof(CtxtHandle));
13721378
if (sspictx==NULL)
13731379
ereport(ERROR,
13741380
(errmsg("out of memory")));
1375-
1376-
memcpy(sspictx,&newctx,sizeof(CtxtHandle));
13771381
}
13781382

1383+
memcpy(sspictx,&newctx,sizeof(CtxtHandle));
1384+
13791385
if (r==SEC_I_CONTINUE_NEEDED)
13801386
elog(DEBUG4,"SSPI continue needed");
13811387

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp