Hi,

post-install tries to determine whether specific parameters need to be updated/replaced in the main.cf configuration file. For this purpose post-install compares several variables to parameter values obtained via postconf. While doing so, post-install tries to unexpand mail_version in those variables. Unfortunately the invocation of test, including the call to postconf, is eval'd. As a result, mail_version will be expanded in the parameter values obtained via postconf. Bottom line: mail_version will be unexpanded in the LHS of test, while being expanded in the RHS of test. This might lead to main.cf being modified by post-install even if not necessary/intended. As "postfix start" invokes post-install via postfix-script, this happens on every start of Postfix.

The described problem applies to Postfix 3.0.0.

A simple patch to make the comparison more robust by not expanding mail_version in the RHS of the test is attached.

Regards,
Julian Reich
diff -ru postfix-3.0.0/conf/post-install postfix/conf/post-install
--- postfix-3.0.0/conf/post-install     2014-06-28 14:49:13.000000000 +0200
+++ postfix/conf/post-install   2015-03-28 16:37:57.000000000 +0100
@@ -450,7 +450,8 @@
 override=
 for name in $MOST_PARAMETERS
 do
-    eval test \"\$$name\" = \"`$POSTCONF -c $config_directory -h $name`\" || {
+    eval junk=\$$name
+    test "$junk" = `$POSTCONF -c $config_directory -h $name` || {
        override=1
        break
     }

Reply via email to