Permalink
Browse files

Merge pull request #5 from radicaled/master

FIX: MySQL Storage adapter passing malformed arguments to mysql binary.
  • Loading branch information...
2 parents aab9432 + 9848368 commit 3103e6bb4c5f567e727162ce436131d1606c5c64 @JonathanTron JonathanTron committed Dec 7, 2012
Showing with 4 additions and 3 deletions.
  1. +4 −3 lib/sequel-rails/storage.rb
@@ -1,3 +1,4 @@
+require 'shellwords'
module Rails
module Sequel
@@ -140,9 +141,9 @@ def _drop
def execute(statement)
commands = ["mysql"]
- commands << "--user" << username unless username.blank?
- commands << "--password" << password unless password.blank?
- commands << "--host" << host unless host.blank?
+ commands << "--user=#{Shellwords.escape(username)}" unless username.blank?
+ commands << "--password=#{Shellwords.escape(password)}" unless password.blank?
+ commands << "--host=#{host}" unless host.blank?
commands << "-e" << statement
system(*commands)
end

0 comments on commit 3103e6b

Please sign in to comment.