lib/backup/database/postgresql.rb in backup-4.0.4 vs lib/backup/database/postgresql.rb in backup-4.0.5
- old
+ new
@@ -86,18 +86,18 @@
"#{ utility(:pg_dumpall) } #{ username_option } " +
"#{ connectivity_options } #{ user_options }"
end
def password_option
- "PGPASSWORD='#{ password }' " if password
+ "PGPASSWORD=#{ Shellwords.escape(password) } " if password
end
def sudo_option
"#{ utility(:sudo) } -n -u #{ sudo_user } " if sudo_user
end
def username_option
- "--username='#{ username }'" if username
+ "--username=#{ Shellwords.escape(username) }" if username
end
def connectivity_options
return "--host='#{ socket }'" if socket