Ticket #398 (new enhancement)

Opened 3 years ago

Last modified 7 weeks ago

pgsql2shp should prompt for password if not supplied in command args

Reported by: mwtoews Owned by: mwtoews
Priority: medium Milestone: PostGIS Future
Component: 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

Changed 3 years ago by mcayland

FWIW I believe that the .pgpass behaviour is handled automatically by the libpq API already, so in theory this part should "just work".

Mark.

Changed 2 years ago by strk

  • component changed from postgis to loader/dumper

Changed 16 months ago by pramsey

  • owner changed from pramsey to mwtoews

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.

Changed 15 months ago by pramsey

  • milestone changed from PostGIS 2.0.0 to PostGIS 2.1.0

Pushing forward.

Changed 7 weeks ago by robe

  • milestone changed from PostGIS 2.1.0 to PostGIS Future

Pushing forward.

Note: See TracTickets for help on using tickets.