diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2017-01-24 17:06:21 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2017-01-24 17:06:34 -0500 |
commit | ba005f193d88a8404e81db3df223cf689d64d75e (patch) | |
tree | 4a620944c4e9c725e34a18a2fe4c991147f3f018 /src/interfaces/libpq/libpq-int.h | |
parent | d1ecd539477fe640455dc890216a7c1561e047b4 (diff) | |
download | postgresql-ba005f193d88a8404e81db3df223cf689d64d75e.tar.gz postgresql-ba005f193d88a8404e81db3df223cf689d64d75e.zip |
Allow password file name to be specified as a libpq connection parameter.
Formerly an alternate password file could only be selected via the
environment variable PGPASSFILE; now it can also be selected via a
new connection parameter "passfile", corresponding to the conventions
for most other connection parameters. There was some concern about
this creating a security weakness, but it was agreed that that argument
was pretty thin, and there are clear use-cases for handling password
files this way.
Julian Markwort, reviewed by Fabien Coelho, some adjustments by me
Discussion: https://postgr.es/m/a4b4f4f1-7b58-a0e8-5268-5f7db8e8ccaa@uni-muenster.de
Diffstat (limited to 'src/interfaces/libpq/libpq-int.h')
-rw-r--r-- | src/interfaces/libpq/libpq-int.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/interfaces/libpq/libpq-int.h b/src/interfaces/libpq/libpq-int.h index 7289bd15c05..c6553888642 100644 --- a/src/interfaces/libpq/libpq-int.h +++ b/src/interfaces/libpq/libpq-int.h @@ -343,6 +343,7 @@ struct pg_conn char *replication; /* connect as the replication standby? */ char *pguser; /* Postgres username and password, if any */ char *pgpass; + char *pgpassfile; /* path to a file containing password(s) */ char *keepalives; /* use TCP keepalives? */ char *keepalives_idle; /* time between TCP keepalives */ char *keepalives_interval; /* time between TCP keepalive @@ -407,7 +408,7 @@ struct pg_conn bool auth_req_received; /* true if any type of auth req * received */ bool password_needed; /* true if server demanded a password */ - bool dot_pgpass_used; /* true if used .pgpass */ + bool pgpassfile_used; /* true if password is from pgpassfile */ bool sigpipe_so; /* have we masked SIGPIPE via SO_NOSIGPIPE? */ bool sigpipe_flag; /* can we mask SIGPIPE via MSG_NOSIGNAL? */ |