Skip to content
This repository has been archived by the owner on Jul 24, 2021. It is now read-only.

osm2pgsql should accept a password as an argument #2359

Closed
openstreetmap-trac opened this issue Jul 23, 2021 · 3 comments
Closed

osm2pgsql should accept a password as an argument #2359

openstreetmap-trac opened this issue Jul 23, 2021 · 3 comments

Comments

@openstreetmap-trac
Copy link

Reporter: aubreyholland[at]gmail.com
[Submitted to the original trac issue database at 9.24pm, Tuesday, 6th October 2009]

osm2pgsql takes arguments for all of the necessary information to connect to the database except for the password. Because the only option it provides for the password is for it to produce a prompt, this means that osm2pgsql can't be called through scripts, cron jobs, etc. without human intervention in cases where a password is required. There are other options for providing the password (the pgpass file, for example), but none of them seem as clean as simply providing the password to the program as other apps like osmosis allow.

I am attaching a diff that adds this feature. It changes the --password (-W) argument to take a password as a parameter and adds another argument, --prompt (-x) that does what --password used to do. I wasn't thrilled about changing the usage of the existing argument, but that seems like what --password really should do.

@openstreetmap-trac
Copy link
Author

Author: TomH
[Added to the original trac issue at 10.59pm, Tuesday, 6th October 2009]

The current form of -W is deliberate - it mirrors all the postgresql tools I believe.

Not allowing passwords on the command line is a security feature as it stops other users being able to see them in process listings.

@openstreetmap-trac
Copy link
Author

Author: jburgess777[at]googlemail.com
[Added to the original trac issue at 11.34pm, Tuesday, 6th October 2009]

I have to agree with Tom. The current choice was to deliberately match 'psql' and similar postgresql tools. If you need things to run from cron etc on localhost then I would recommend using ident authentication which is arguably even more secure than using a password.

@openstreetmap-trac
Copy link
Author

Author: amm
[Added to the original trac issue at 5.44pm, Monday, 16th September 2013]

I would second TomH and jburgess, so I am closing this ticket as won't fix. There also hasn't been any activity on this ticket for the last 4 years.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant