diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-11-05 17:35:49 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-11-05 17:35:49 +0400 |
commit | f9b66aecddb248dcd501419e0ee94fd69fab4de3 (patch) | |
tree | d924e72bbaa4b6dd2fbea631620a22dd5253df8f /lib/backup/database.rb | |
parent | ad41430c29514d14e79722c8813df246949fd798 (diff) |
Revert "More escaping"
This reverts commit c46eaca91247ccf8e6fb3b691dad028e1b084ae3.
Diffstat (limited to 'lib/backup/database.rb')
-rw-r--r-- | lib/backup/database.rb | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/backup/database.rb b/lib/backup/database.rb index 6ada5bb4ea2..c4fb2e2e159 100644 --- a/lib/backup/database.rb +++ b/lib/backup/database.rb @@ -1,5 +1,4 @@ require 'yaml' -require 'shellwords' module Backup class Database @@ -14,20 +13,20 @@ module Backup def dump case config["adapter"] when /^mysql/ then - system("mysqldump #{mysql_args} #{Shellwords.shellescape(config['database'])} > #{Shellwords.shellescape(db_file_name)}") + system("mysqldump #{mysql_args} #{config['database']} > #{db_file_name}") when "postgresql" then pg_env - system("pg_dump #{Shellwords.shellescape(config['database'])} > #{db_file_name}") + system("pg_dump #{config['database']} > #{db_file_name}") end end def restore case config["adapter"] when /^mysql/ then - system("mysql #{mysql_args} #{Shellwords.shellescape(config['database'])} < #{db_file_name}") + system("mysql #{mysql_args} #{config['database']} < #{db_file_name}") when "postgresql" then pg_env - system("psql #{Shellwords.shellescape(config['database'])} -f #{Shellwords.shellescape(db_file_name)}") + system("psql #{config['database']} -f #{db_file_name}") end end @@ -46,7 +45,7 @@ module Backup 'encoding' => '--default-character-set', 'password' => '--password' } - args.map { |opt, arg| "#{arg}=#{Shellwords.shellescape(config[opt])}" if config[opt] }.compact.join(' ') + args.map { |opt, arg| "#{arg}='#{config[opt]}'" if config[opt] }.compact.join(' ') end def pg_env |