Ticket #2359 (closed enhancement: wontfix)

Opened 5 years ago

Last modified 7 months ago

osm2pgsql should accept a password as an argument

Reported by: aubreyholland@… Owned by: jburgess777@…
Priority: major Milestone:
Component: osm2pgsql Version:
Keywords: osm2pgsql password Cc:

Description

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.

Attachments

osm2pgsql.diff Download (2.4 KB) - added by aubreyholland@… 5 years ago.
A diff that adds the requested functionality

Change History

Changed 5 years ago by aubreyholland@…

A diff that adds the requested functionality

comment:1 Changed 5 years ago by TomH

  • Owner changed from tom@… to jburgess777@…

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.

comment:2 Changed 5 years ago by jburgess777@…

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.

comment:3 Changed 3 years ago by TomH

  • Component changed from utils to osm2pgsql

comment:4 Changed 7 months ago by amm

  • Status changed from new to closed
  • Resolution set to wontfix

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.

Note: See TracTickets for help on using tickets.