OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
Re: [patch] "post-install" has forgotten to read data_directory value.

From: Wietse Venema (wietseporcupine.org)
Date: Thu Jan 31 2008 - 18:33:45 CST


Victor Duchovni:
> On Thu, Jan 31, 2008 at 06:11:29PM -0500, Wietse Venema wrote:
>
> > > data_directory =
> >
> > This makes no sense. "postfix start" does not change main.cf.
> > I installed versions of 20080127 on several *BSD and Linux systems.
>
> The only way that "postfix start" can change main.cf (via create-missing)
> is for the environment passed by postfix(1) to postfix-script and hence
> to post-install to (miraculously) differ from the main.cf settings that
> post-install computes via "postconf -h". However, even in that case,
> empty values should not be possible, because the sanity check at the
> top of post-install should bail out early.
>
> I see no code path that matches the reported symptoms, the installation
> or run-time environment is likely damaged.

Note this:

    for name in config_directory $MOST_PARAMETERS
    do
        eval test -n \${$name} || {
            echo "$0: Error: do not invoke this command directly" 1>&2
            echo Re-run this command as: postfix $0 ... 1>&2
            exit 1
        }
    done

This does not work reliably because the "test -n" argument needs to
be quoted.

Correct is this:

    for name in config_directory $MOST_PARAMETERS
    do
        eval test -n \"\${$name}\" || {
            echo "$0: Error: do not invoke this command directly" 1>&2
            echo Re-run this command as: postfix $0 ... 1>&2
            exit 1
        }
    done

I'll roll out another snapshot.

        Wietse