diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/interfaces/libpq/fe-connect.c | 25 | ||||
-rw-r--r-- | src/interfaces/libpq/libpq-int.h | 11 |
2 files changed, 9 insertions, 27 deletions
diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c index 84765a79fee..d9e1d0c2548 100644 --- a/src/interfaces/libpq/fe-connect.c +++ b/src/interfaces/libpq/fe-connect.c @@ -309,30 +309,21 @@ static const internalPQconninfoOption PQconninfoOptions[] = { offsetof(struct pg_conn, requirepeer)}, /* - * Expose gssencmode similarly to sslmode - we can still handle "disable" - * and "prefer". + * As with SSL, all GSS options are exposed even in builds that don't have + * support. */ {"gssencmode", "PGGSSENCMODE", DefaultGSSMode, NULL, "GSSENC-Mode", "", 7, /* sizeof("disable") == 7 */ offsetof(struct pg_conn, gssencmode)}, -#if defined(ENABLE_GSS) || defined(ENABLE_SSPI) /* 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, @@ -3966,14 +3957,14 @@ freePGconn(PGconn *conn) free(conn->sslcompression); if (conn->requirepeer) free(conn->requirepeer); - if (conn->connip) - free(conn->connip); if (conn->gssencmode) free(conn->gssencmode); -#if defined(ENABLE_GSS) || defined(ENABLE_SSPI) if (conn->krbsrvname) free(conn->krbsrvname); -#endif + if (conn->gsslib) + free(conn->gsslib); + if (conn->connip) + free(conn->connip); #ifdef ENABLE_GSS if (conn->gcred != GSS_C_NO_CREDENTIAL) { @@ -3990,10 +3981,6 @@ freePGconn(PGconn *conn) conn->gctx = NULL; } #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 c0b8e3f8cef..f4e1a03a259 100644 --- a/src/interfaces/libpq/libpq-int.h +++ b/src/interfaces/libpq/libpq-int.h @@ -359,10 +359,10 @@ 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 *gssencmode; /* GSS mode (require,prefer,disable) */ char *krbsrvname; /* Kerberos service name */ -#endif + char *gsslib; /* What GSS library to use ("gssapi" or + * "sspi") */ /* Type of connection to make. Possible values: any, read-write. */ char *target_session_attrs; @@ -481,7 +481,6 @@ struct pg_conn #endif /* USE_OPENSSL */ #endif /* USE_SSL */ - char *gssencmode; /* GSS mode (require,prefer,disable) */ #ifdef ENABLE_GSS gss_ctx_id_t gctx; /* GSS context */ gss_name_t gtarg_nam; /* GSS target name */ @@ -493,10 +492,6 @@ struct pg_conn #endif #ifdef ENABLE_SSPI -#ifdef ENABLE_GSS - char *gsslib; /* What GSS library to use ("gssapi" or - * "sspi") */ -#endif CredHandle *sspicred; /* SSPI credentials handle */ CtxtHandle *sspictx; /* SSPI context */ char *sspitarget; /* SSPI target name */ |