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 mcayland, 15 years ago

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

Mark.

comment:2 by strk, 14 years ago

Component: postgisloader/dumper

comment:3 by pramsey, 13 years ago

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.

comment:4 by pramsey, 13 years ago

Milestone: PostGIS 2.0.0PostGIS 2.1.0

Pushing forward.

comment:5 by robe, 12 years ago

Milestone: PostGIS 2.1.0PostGIS Future

Pushing forward.

comment:6 by robe, 7 years ago

Milestone: PostGIS FuturePostGIS Fund Me

Milestone renamed

Note: See TracTickets for help on using tickets.