Permalink
Browse files

Merge pull request #5925 from Juanmcuello/pg_structure_dump

Quote arguments in db:structure:dump for PostgreSQL.
  • Loading branch information...
2 parents 356f2a6 + 587de84 commit a9af9f10cb841ed1c2f51c7990cef76297b15e39 @carlosantoniodasilva carlosantoniodasilva committed May 24, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 activerecord/lib/active_record/railties/databases.rake
@@ -387,9 +387,9 @@ db_namespace = namespace :db do
set_psql_env(abcs[Rails.env])
search_path = abcs[Rails.env]['schema_search_path']
unless search_path.blank?
- search_path = search_path.split(",").map{|search_path_part| "--schema=#{search_path_part.strip}" }.join(" ")
+ search_path = search_path.split(",").map{|search_path_part| "--schema=#{Shellwords.escape(search_path_part.strip)}" }.join(" ")
end
- `pg_dump -i -s -x -O -f #{filename} #{search_path} #{abcs[Rails.env]['database']}`
+ `pg_dump -i -s -x -O -f #{Shellwords.escape(filename)} #{search_path} #{Shellwords.escape(abcs[Rails.env]['database'])}`
raise 'Error dumping database' if $?.exitstatus == 1
when /sqlite/
dbfile = abcs[Rails.env]['database']

0 comments on commit a9af9f1

Please sign in to comment.