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

Commit0886dde

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 parentd71197c commit0886dde

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
@@ -1349,16 +1349,22 @@ pg_SSPI_recvauth(Port *port)
13491349
_("could not accept SSPI security context"),r);
13501350
}
13511351

1352+
/*
1353+
* Overwrite the current context with the one we just received.
1354+
* If sspictx is NULL it was the first loop and we need to allocate
1355+
* a buffer for it. On subsequent runs, we can just overwrite the
1356+
* buffer contents since the size does not change.
1357+
*/
13521358
if (sspictx==NULL)
13531359
{
13541360
sspictx=malloc(sizeof(CtxtHandle));
13551361
if (sspictx==NULL)
13561362
ereport(ERROR,
13571363
(errmsg("out of memory")));
1358-
1359-
memcpy(sspictx,&newctx,sizeof(CtxtHandle));
13601364
}
13611365

1366+
memcpy(sspictx,&newctx,sizeof(CtxtHandle));
1367+
13621368
if (r==SEC_I_CONTINUE_NEEDED)
13631369
elog(DEBUG4,"SSPI continue needed");
13641370

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp