diff --git a/contrib/postgres_fdw/expected/postgres_fdw.out b/contrib/postgres_fdw/expected/postgres_fdw.out index 65b1e86b5fa..726ed18b994 100644 --- a/contrib/postgres_fdw/expected/postgres_fdw.out +++ b/contrib/postgres_fdw/expected/postgres_fdw.out @@ -127,8 +127,8 @@ CREATE FOREIGN TABLE ft6 ( -- =================================================================== -- tests for validator -- =================================================================== --- requiressl, krbsrvname and gsslib are omitted because they depend on --- configure options +-- requiressl and some other parameters are omitted because +-- valid values for them depend on configure options ALTER SERVER testserver1 OPTIONS ( use_remote_estimate 'false', updatable 'true', @@ -152,10 +152,10 @@ ALTER SERVER testserver1 OPTIONS ( sslcert 'value', sslkey 'value', sslrootcert 'value', - sslcrl 'value' + sslcrl 'value', --requirepeer 'value', - -- krbsrvname 'value', - -- gsslib 'value', + krbsrvname 'value', + gsslib 'value' --replication 'value' ); -- Error, invalid list syntax diff --git a/contrib/postgres_fdw/sql/postgres_fdw.sql b/contrib/postgres_fdw/sql/postgres_fdw.sql index a3ad6a85e3e..27c0682dad7 100644 --- a/contrib/postgres_fdw/sql/postgres_fdw.sql +++ b/contrib/postgres_fdw/sql/postgres_fdw.sql @@ -139,8 +139,8 @@ CREATE FOREIGN TABLE ft6 ( -- =================================================================== -- tests for validator -- =================================================================== --- requiressl, krbsrvname and gsslib are omitted because they depend on --- configure options +-- requiressl and some other parameters are omitted because +-- valid values for them depend on configure options ALTER SERVER testserver1 OPTIONS ( use_remote_estimate 'false', updatable 'true', @@ -164,10 +164,10 @@ ALTER SERVER testserver1 OPTIONS ( sslcert 'value', sslkey 'value', sslrootcert 'value', - sslcrl 'value' + sslcrl 'value', --requirepeer 'value', - -- krbsrvname 'value', - -- gsslib 'value', + krbsrvname 'value', + gsslib 'value' --replication 'value' ); diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml index 951c9ec6879..101c1ad56d9 100644 --- a/doc/src/sgml/libpq.sgml +++ b/doc/src/sgml/libpq.sgml @@ -1366,8 +1366,10 @@ postgresql://%2Fvar%2Flib%2Fpostgresql/dbname gsslib - GSS library to use for GSSAPI authentication. Only used on Windows. - Set to gssapi to force libpq to use the GSSAPI + GSS library to use for GSSAPI authentication. + Currently this is disregarded except on Windows builds that include + both GSSAPI and SSPI support. In that case, set + this to gssapi to cause libpq to use the GSSAPI library for authentication instead of the default SSPI. diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c index eb7a2184d64..9ad03f33be1 100644 --- a/src/interfaces/libpq/fe-connect.c +++ b/src/interfaces/libpq/fe-connect.c @@ -297,23 +297,19 @@ static const internalPQconninfoOption PQconninfoOptions[] = { "Require-Peer", "", 10, offsetof(struct pg_conn, requirepeer)}, -#if defined(ENABLE_GSS) || defined(ENABLE_SSPI) + /* + * As with SSL, all GSS options are exposed even in builds that don't have + * support. + */ + /* Kerberos and GSSAPI authentication support specifying the service name */ {"krbsrvname", "PGKRBSRVNAME", PG_KRB_SRVNAM, NULL, "Kerberos-service-name", "", 20, offsetof(struct pg_conn, krbsrvname)}, -#endif -#if defined(ENABLE_GSS) && defined(ENABLE_SSPI) - - /* - * GSSAPI and SSPI both enabled, give a way to override which is used by - * default - */ {"gsslib", "PGGSSLIB", NULL, NULL, "GSS-library", "", 7, /* sizeof("gssapi") = 7 */ offsetof(struct pg_conn, gsslib)}, -#endif {"replication", NULL, NULL, NULL, "Replication", "D", 5, @@ -3064,14 +3060,10 @@ freePGconn(PGconn *conn) free(conn->sslcompression); if (conn->requirepeer) free(conn->requirepeer); -#if defined(ENABLE_GSS) || defined(ENABLE_SSPI) if (conn->krbsrvname) free(conn->krbsrvname); -#endif -#if defined(ENABLE_GSS) && defined(ENABLE_SSPI) if (conn->gsslib) free(conn->gsslib); -#endif /* Note that conn->Pfdebug is not ours to close or free */ if (conn->last_query) free(conn->last_query); diff --git a/src/interfaces/libpq/libpq-int.h b/src/interfaces/libpq/libpq-int.h index e7878a87816..aa04bf0a4dd 100644 --- a/src/interfaces/libpq/libpq-int.h +++ b/src/interfaces/libpq/libpq-int.h @@ -330,10 +330,9 @@ struct pg_conn char *sslrootcert; /* root certificate filename */ char *sslcrl; /* certificate revocation list filename */ char *requirepeer; /* required peer credentials for local sockets */ - -#if defined(ENABLE_GSS) || defined(ENABLE_SSPI) char *krbsrvname; /* Kerberos service name */ -#endif + char *gsslib; /* What GSS library to use ("gssapi" or + * "sspi") */ /* Optional file to write trace info to */ FILE *Pfdebug; @@ -453,9 +452,6 @@ struct pg_conn #ifdef ENABLE_SSPI #ifndef ENABLE_GSS gss_buffer_desc ginbuf; /* GSS input token */ -#else - char *gsslib; /* What GSS librart to use ("gssapi" or - * "sspi") */ #endif CredHandle *sspicred; /* SSPI credentials handle */ CtxtHandle *sspictx; /* SSPI context */