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

Commit4ea1a27

Browse files
committed
Use GSSAPI library for SSPI auth, when native SSPI is not available
This allows non-Windows clients to connect to a Windowsserver with SSPI authentication.Christian Ullrich, largely modified by me
1 parent7f242d8 commit4ea1a27

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

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

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -831,6 +831,10 @@ pg_fe_sendauth(AuthRequest areq, PGconn *conn)
831831

832832
#if defined(ENABLE_GSS)|| defined(ENABLE_SSPI)
833833
caseAUTH_REQ_GSS:
834+
#if !defined(ENABLE_SSPI)
835+
/* no native SSPI, so use GSSAPI library for it */
836+
caseAUTH_REQ_SSPI:
837+
#endif
834838
{
835839
intr;
836840

@@ -888,13 +892,14 @@ pg_fe_sendauth(AuthRequest areq, PGconn *conn)
888892
pgunlock_thread();
889893
}
890894
break;
891-
#else
895+
#else/* defined(ENABLE_GSS) || defined(ENABLE_SSPI) */
896+
/* No GSSAPI *or* SSPI support */
892897
caseAUTH_REQ_GSS:
893898
caseAUTH_REQ_GSS_CONT:
894899
printfPQExpBuffer(&conn->errorMessage,
895900
libpq_gettext("GSSAPI authentication not supported\n"));
896901
returnSTATUS_ERROR;
897-
#endif
902+
#endif/* defined(ENABLE_GSS) || defined(ENABLE_SSPI) */
898903

899904
#ifdefENABLE_SSPI
900905
caseAUTH_REQ_SSPI:
@@ -914,11 +919,19 @@ pg_fe_sendauth(AuthRequest areq, PGconn *conn)
914919
pgunlock_thread();
915920
break;
916921
#else
922+
/*
923+
* No SSPI support. However, if we have GSSAPI but not SSPI
924+
* support, AUTH_REQ_SSPI will have been handled in the codepath
925+
* for AUTH_REQ_GSSAPI above, so don't duplicate the case label
926+
* in that case.
927+
*/
928+
#if !defined(ENABLE_GSS)
917929
caseAUTH_REQ_SSPI:
918930
printfPQExpBuffer(&conn->errorMessage,
919931
libpq_gettext("SSPI authentication not supported\n"));
920932
returnSTATUS_ERROR;
921-
#endif
933+
#endif/* !define(ENABLE_GSSAPI) */
934+
#endif/* ENABLE_SSPI */
922935

923936

924937
caseAUTH_REQ_CRYPT:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp