Viktor Dukhovni:
> On Sat, Mar 28, 2015 at 05:32:36PM +0100, Julian Reich wrote:
> 
> > 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.
> > 
> > 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
> >      }
> 
> Basically right, but I would add a layer of quotes, and perhaps
> not change any settings unless we're installing or upgrading (the
> patch should likely suppress the initial comparison loop when not
> installing or upgrading, but would make the diffs less clear).
> 
> diff --git a/conf/post-install b/conf/post-install
> index 7e79c92..4178134 100644
> --- a/conf/post-install
> +++ b/conf/post-install
> @@ -417,13 +417,14 @@ POSTCONF="$command_directory/postconf"
>  override=
>  for name in $MOST_PARAMETERS
>  do
> -    eval test \"\$$name\" = \"`$POSTCONF -c $config_directory -h $name`\" || 
> {
> +    eval junk="\${$name}"

I think that should be

        eval junk=\"\$$name\"

The quotes are needed to contain value of the indirectly-referenced
parameter. The quotes are not needed for $name which cannot contain
spaces, as $name is generated with ``for name in $MOST_PARAMETERS''.

> -test -n "$override" && {
> +test -n "$override" -a -n "$upgrade_conf$first_install_reminder" && {

I think that set-permissions also changes the main.cf file. So let's
not break this part, yet.

        Wietse

>      $POSTCONF -c $config_directory -e \
>       "daemon_directory = $daemon_directory" \
>       "command_directory = $command_directory" \
> 
> -- 
>       Viktor.
> 

Reply via email to