diff options
author | Juan M. Cuello <juanmacuello@gmail.com> | 2012-04-21 17:59:30 -0300 |
---|---|---|
committer | Juan M. Cuello <juanmacuello@gmail.com> | 2012-05-22 23:49:35 -0300 |
commit | 587de842581fa604564595c58019161f6acc4b1b (patch) | |
tree | 7798546112308847965ecae083fec3b51d6842f9 /activerecord/lib/active_record | |
parent | ff3cddf8763e100947cdffe9c25716e93ccbac62 (diff) | |
download | rails-587de842581fa604564595c58019161f6acc4b1b.tar.gz rails-587de842581fa604564595c58019161f6acc4b1b.tar.bz2 rails-587de842581fa604564595c58019161f6acc4b1b.zip |
Use Shellwords to scape arguments in db:structure:dump for PostgreSQL.
fixes #5913
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/railties/databases.rake | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/railties/databases.rake b/activerecord/lib/active_record/railties/databases.rake index 4985abc31a..abdd935bdc 100644 --- a/activerecord/lib/active_record/railties/databases.rake +++ b/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'] |