Opened 15 years ago
Last modified 7 years ago
#398 new enhancement
pgsql2shp should prompt for password if not supplied in command args
Reported by: | mwtoews | Owned by: | mwtoews |
---|---|---|---|
Priority: | medium | Milestone: | PostGIS Fund Me |
Component: | utils/loader-dumper | Version: | |
Keywords: | Cc: |
Description
Presently, if no -P <password> is supplied to pgsql2shp, an error (depending on pg_hba.conf configurations) shows:
pgsql2shp dbname tablename fe_sendauth: no password supplied
It appears that the -P <password> is required, however this opens a security risk as the password is visible and in the command history.
This enhancement request is to mimic the behaviour of psql, whereby a prompt is shown if no password is supplied. A bonus request would be to use .pgpass or pgpass.conf for the password, if available.
Change History (6)
comment:1 by , 15 years ago
comment:2 by , 14 years ago
Component: | postgis → loader/dumper |
---|
comment:3 by , 13 years ago
Owner: | changed from | to
---|
I'm finding it hard to work up much enthusiasm for this, particularly as it will involve testing on Windows. I did find the sprompt.c file in PgSQL and it's easy to copy into our tree. I'll commit the configure test to create the #define it likes. After that it looks like the code in psql startup.c provides a good template for implementation. Remember to use PQconnectionNeedsPassword when testing a failed connection. I'll leave this in the 2.0 milestone for a while and then punt it to 2.1.
FWIW I believe that the .pgpass behaviour is handled automatically by the libpq API already, so in theory this part should "just work".
Mark.