mirror of
https://github.com/postgres/postgres.git
synced 2025-08-28 18:48:04 +03:00
Spell the values of libpq's gssdelegation parameter as "0" and "1".
That's how other boolean options are handled, so do likewise. The previous coding with "enable" and "disable" was seemingly modeled on gssencmode, but that's a three-way flag. While at it, add PGGSSDELEGATION to the set of environment variables cleared by pg_regress and Utils.pm. Abhijit Menon-Sen, per gripe from Alvaro Herrera Discussion: https://postgr.es/m/20230522091609.nlyuu4nolhycqs2p@alvherre.pgsql
This commit is contained in:
@@ -97,7 +97,7 @@ pg_GSS_continue(PGconn *conn, int payloadlen)
|
||||
if (!pg_GSS_have_cred_cache(&conn->gcred))
|
||||
conn->gcred = GSS_C_NO_CREDENTIAL;
|
||||
|
||||
if (conn->gssdelegation && pg_strcasecmp(conn->gssdelegation, "enable") == 0)
|
||||
if (conn->gssdelegation && conn->gssdelegation[0] == '1')
|
||||
gss_flags |= GSS_C_DELEG_FLAG;
|
||||
|
||||
maj_stat = gss_init_sec_context(&min_stat,
|
||||
|
@@ -343,8 +343,8 @@ static const internalPQconninfoOption PQconninfoOptions[] = {
|
||||
"GSS-library", "", 7, /* sizeof("gssapi") == 7 */
|
||||
offsetof(struct pg_conn, gsslib)},
|
||||
|
||||
{"gssdelegation", "PGGSSDELEGATION", NULL, NULL,
|
||||
"GSS-delegation", "", 8, /* sizeof("disable") == 8 */
|
||||
{"gssdelegation", "PGGSSDELEGATION", "0", NULL,
|
||||
"GSS-delegation", "", 1,
|
||||
offsetof(struct pg_conn, gssdelegation)},
|
||||
|
||||
{"replication", NULL, NULL, NULL,
|
||||
|
@@ -622,7 +622,7 @@ pqsecure_open_gss(PGconn *conn)
|
||||
if (ret != STATUS_OK)
|
||||
return PGRES_POLLING_FAILED;
|
||||
|
||||
if (conn->gssdelegation && pg_strcasecmp(conn->gssdelegation, "enable") == 0)
|
||||
if (conn->gssdelegation && conn->gssdelegation[0] == '1')
|
||||
{
|
||||
/* Acquire credentials if possible */
|
||||
if (conn->gcred == GSS_C_NO_CREDENTIAL)
|
||||
|
@@ -404,7 +404,7 @@ struct pg_conn
|
||||
char *krbsrvname; /* Kerberos service name */
|
||||
char *gsslib; /* What GSS library to use ("gssapi" or
|
||||
* "sspi") */
|
||||
char *gssdelegation; /* Try to delegate GSS credentials? */
|
||||
char *gssdelegation; /* Try to delegate GSS credentials? (0 or 1) */
|
||||
char *ssl_min_protocol_version; /* minimum TLS protocol version */
|
||||
char *ssl_max_protocol_version; /* maximum TLS protocol version */
|
||||
char *target_session_attrs; /* desired session properties */
|
||||
|
Reference in New Issue
Block a user