]> gitweb.michael.orlitzky.com - mailshears.git/commitdiff
Fix SQL query clobbering in PostfixadminMv.
authorMichael Orlitzky <michael@orlitzky.com>
Wed, 17 Sep 2014 15:56:47 +0000 (11:56 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Wed, 17 Sep 2014 15:56:47 +0000 (11:56 -0400)
lib/mv/plugins/postfixadmin.rb

index 223c716b082ae8d089973d5316234d07f003d3ee..5cc34e33c6f6134d7512581f639f8da59833639f 100644 (file)
@@ -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