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

Commit885604d

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 parentf844022 commit885604d

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
@@ -1353,16 +1353,22 @@ pg_SSPI_recvauth(Port *port)
13531353
_("could not accept SSPI security context"),r);
13541354
}
13551355

1356+
/*
1357+
* Overwrite the current context with the one we just received.
1358+
* If sspictx is NULL it was the first loop and we need to allocate
1359+
* a buffer for it. On subsequent runs, we can just overwrite the
1360+
* buffer contents since the size does not change.
1361+
*/
13561362
if (sspictx==NULL)
13571363
{
13581364
sspictx=malloc(sizeof(CtxtHandle));
13591365
if (sspictx==NULL)
13601366
ereport(ERROR,
13611367
(errmsg("out of memory")));
1362-
1363-
memcpy(sspictx,&newctx,sizeof(CtxtHandle));
13641368
}
13651369

1370+
memcpy(sspictx,&newctx,sizeof(CtxtHandle));
1371+
13661372
if (r==SEC_I_CONTINUE_NEEDED)
13671373
elog(DEBUG4,"SSPI continue needed");
13681374

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp