From: Michael Orlitzky Date: Wed, 17 Sep 2014 15:56:47 +0000 (-0400) Subject: Fix SQL query clobbering in PostfixadminMv. X-Git-Tag: 0.0.1~58 X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=ca9ea0fe29615be543114431b26a057f5d6a2a6b;p=mailshears.git Fix SQL query clobbering in PostfixadminMv. --- diff --git a/lib/mv/plugins/postfixadmin.rb b/lib/mv/plugins/postfixadmin.rb index 223c716..5cc34e3 100644 --- a/lib/mv/plugins/postfixadmin.rb +++ b/lib/mv/plugins/postfixadmin.rb @@ -22,12 +22,12 @@ class PostfixadminMv local_part=$3 WHERE username=$4;'] - sql_queries = ['UPDATE alias SET address=$1, + sql_queries << 'UPDATE alias SET address=$1, domain=$2, - goto=REPLACE(goto, $4, $1); - WHERE address=$4;'] + goto=REPLACE(goto, $4, $1) + WHERE address=$4;' - sql_queries = ['UPDATE alias SET goto=REPLACE(GOTO, $4, $1);'] + sql_queries << 'UPDATE alias SET goto=REPLACE(GOTO, $4, $1);' begin connection = PGconn.connect(@db_host, @@ -51,6 +51,7 @@ class PostfixadminMv # Pretend like we're database-agnostic in case we ever are. raise DatabaseError.new(e) end + end