diff options
Diffstat (limited to 'contrib/postgres_fdw')
-rw-r--r-- | contrib/postgres_fdw/connection.c | 5 | ||||
-rw-r--r-- | contrib/postgres_fdw/option.c | 12 |
2 files changed, 9 insertions, 8 deletions
diff --git a/contrib/postgres_fdw/connection.c b/contrib/postgres_fdw/connection.c index e45647f3eaf..52d1fe35631 100644 --- a/contrib/postgres_fdw/connection.c +++ b/contrib/postgres_fdw/connection.c @@ -303,8 +303,8 @@ connect_pg_server(ForeignServer *server, UserMapping *user) /* * Check that non-superuser has used password to establish connection; * otherwise, he's piggybacking on the postgres server's user - * identity. See also dblink_security_check() in contrib/dblink - * and check_conn_params. + * identity. See also dblink_security_check() in contrib/dblink and + * check_conn_params. */ if (!superuser_arg(user->userid) && UserMappingPasswordRequired(user) && !PQconnectionUsedPassword(conn)) @@ -361,6 +361,7 @@ UserMappingPasswordRequired(UserMapping *user) foreach(cell, user->options) { DefElem *def = (DefElem *) lfirst(cell); + if (strcmp(def->defname, "password_required") == 0) return defGetBoolean(def); } diff --git a/contrib/postgres_fdw/option.c b/contrib/postgres_fdw/option.c index c442af5bb96..1a03e02263e 100644 --- a/contrib/postgres_fdw/option.c +++ b/contrib/postgres_fdw/option.c @@ -144,13 +144,13 @@ postgres_fdw_validator(PG_FUNCTION_ARGS) } else if (strcmp(def->defname, "password_required") == 0) { - bool pw_required = defGetBoolean(def); + bool pw_required = defGetBoolean(def); /* * Only the superuser may set this option on a user mapping, or * alter a user mapping on which this option is set. We allow a - * user to clear this option if it's set - in fact, we don't have a - * choice since we can't see the old mapping when validating an + * user to clear this option if it's set - in fact, we don't have + * a choice since we can't see the old mapping when validating an * alter. */ if (!superuser() && !pw_required) @@ -204,11 +204,11 @@ InitPgFdwOptions(void) {"fetch_size", ForeignServerRelationId, false}, {"fetch_size", ForeignTableRelationId, false}, {"password_required", UserMappingRelationId, false}, + /* * sslcert and sslkey are in fact libpq options, but we repeat them - * here to allow them to appear in both foreign server context - * (when we generate libpq options) and user mapping context - * (from here). + * here to allow them to appear in both foreign server context (when + * we generate libpq options) and user mapping context (from here). */ {"sslcert", UserMappingRelationId, true}, {"sslkey", UserMappingRelationId, true}, |