From ca9ea0fe29615be543114431b26a057f5d6a2a6b Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Wed, 17 Sep 2014 11:56:47 -0400 Subject: [PATCH] Fix SQL query clobbering in PostfixadminMv. --- lib/mv/plugins/postfixadmin.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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 -- 2.44.2