From a41446a502744595ba0f2e58682367fa24df6562 Mon Sep 17 00:00:00 2001 From: Will Jordan Date: Thu, 1 Mar 2018 12:08:35 -0800 Subject: [PATCH] single quote password in restore command > Followup to #3283. Quotes passwords passed to shell for backup restore. --- lib/backup_restore/restorer.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/backup_restore/restorer.rb b/lib/backup_restore/restorer.rb index c0c2b413770..fcffe922816 100644 --- a/lib/backup_restore/restorer.rb +++ b/lib/backup_restore/restorer.rb @@ -282,7 +282,7 @@ module BackupRestore def psql_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?