Wietse Venema:
> Robert Moskowitz:
> >
> >
> > On 2/8/19 2:10 PM, Viktor Dukhovni wrote:
> > >> On Feb 8, 2019, at 2:07 PM, Robert Moskowitz <
[hidden email]> wrote:
> > >>
> > >> Much easier to automate changes (as we had nothing like postconf -e for changing master.cf). If I read the patch right, you are providing a warning of the double entry. Perhaps a better patch would warn and drop all but the last entry?
> > > It is not the job of master(8) to edit master.cf. Indeed that file
> > > might reside in read-only storage.
> > >
> > > If you meant "use only the last one", as Wietse also notes, that's the
> > > current behaviour.
> > >
> > Ah, so it is my muddled reading.
> >
> > I did not think that postfix should edit master.cf. Only its internal
> > processes would use the last entry found.
>
> To make this abundantly clear, adding this warning does not change program behavior.
Well it is not supposed to. This is a revised version of the patch,
Wietse
diff -ur src/master/master_conf.c- src/master/master_conf.c
--- src/master/master_conf.c- 2011-09-07 12:58:45.000000000 -0400
+++ src/master/master_conf.c 2019-02-08 17:30:15.000000000 -0500
@@ -123,7 +123,11 @@
* settings.
*/
else {
- serv->flags &= ~MASTER_FLAG_MARK;
+ if ((serv->flags & MASTER_FLAG_MARK) == 0)
+ msg_warn("duplicate master.cf entry for service \"%s\" (%s) "
+ "-- using the last entry", serv->ext_name, serv->name);
+ else
+ serv->flags &= ~MASTER_FLAG_MARK;
if (entry->flags & MASTER_FLAG_CONDWAKE)
serv->flags |= MASTER_FLAG_CONDWAKE;
else