single quote password in backup command

This protects against characters like '&' in passwords. Sometimes you are assigned passwords by idiots or are and idiot that uses pronounceable passwords.  Anyways this small change protects against ruby's shell interpreter from background the pg_dump command before it has really started.
This commit is contained in:
Erik Ordway 2015-03-19 08:39:15 -07:00
parent a7a3b199ef
commit c0881a6a7d
1 changed files with 1 additions and 1 deletions

View File

@ -174,7 +174,7 @@ module BackupRestore
def pg_dump_command
db_conf = BackupRestore.database_configuration
password_argument = "PGPASSWORD=#{db_conf.password}" if db_conf.password.present?
password_argument = "PGPASSWORD='#{db_conf.password}'" if db_conf.password.present?
host_argument = "--host=#{db_conf.host}" if db_conf.host.present?
port_argument = "--port=#{db_conf.port}" if db_conf.port.present?
username_argument = "--username=#{db_conf.username}" if db_conf.username.present?