From admin@ns0.westbend.net Sat Aug  7 17:24:34 1999
Return-Path: <admin@ns0.westbend.net>
Received: from ns0.westbend.net (ns0.westbend.net [209.224.254.130])
	by hub.freebsd.org (Postfix) with ESMTP id 3EBCF14C8A
	for <FreeBSD-gnats-submit@freebsd.org>; Sat,  7 Aug 1999 17:24:20 -0700 (PDT)
	(envelope-from admin@ns0.westbend.net)
Received: (from root@localhost)
	by ns0.westbend.net (8.9.3/8.9.3) id TAA65398;
	Sat, 7 Aug 1999 19:23:42 -0500 (CDT)
	(envelope-from admin)
Message-Id: <199908080023.TAA65398@ns0.westbend.net>
Date: Sat, 7 Aug 1999 19:23:42 -0500 (CDT)
From: "Scot W. Hetzel" <hetzels@westbend.net>
Sender: admin@ns0.westbend.net
Reply-To: hetzels@westbend.net
To: FreeBSD-gnats-submit@freebsd.org
Subject: Wrong sendmail.cf file used by mergemaster
X-Send-Pr-Version: 3.2

>Number:         13016
>Category:       conf
>Synopsis:       Wrong sendmail.cf file used by mergemaster
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    gshapiro
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Aug  7 17:30:01 PDT 1999
>Closed-Date:    Tue Feb 27 18:56:46 PST 2001
>Last-Modified:  Tue Feb 27 18:57:31 PST 2001
>Originator:     Scot W. Hetzel <hetzels@westbend.net>
>Release:        FreeBSD 3.2-STABLE i386
>Organization:
West Bend Internet
>Environment:

	FreeBSD 3.2-STABLE

>Description:

When using MergeMaster to update your /etc directory, it does a comparison
between the /var/tmp/temproot/etc/sendmail.cf(freebsd.cf) file and the
current /etc/sendmail.cf file.  If the current sendmail.cf file was created
by a different custom.mc file, then the comparison is useless. As
we are more concerned with what has changed between our custom.cf file,
and not with what has changed between the custom.cf and freebsd.cf files.

The included patches solve this problem by defining SENDMAIL_CF?=freebsd.cf
in the etc/sendmail/Makefile, which can then be re-defined in the make.conf
file.

Also, added RELEASE_CF?=freebsd.cf to the release/Makefile, so that RELEASE
builds will still use freebsd.cf instead of ${SENDMAIL_CF}.  This can be set
in make.conf to specify a different *.cf file to use instead.

>How-To-Repeat:

1. Create a custom *.mc file
2. add SENDMAIL_CF=<[custom_mc_name].cf> to make.conf
3. create the *.cf file ( cd /usr/src/etc/sendmail ; make install)
4. execute MergeMaster

MergeMaster will show the difference between your custom.cf file and the
freebsd.cf file.

>Fix:

Apply these 3 patches to  etc/Makefile, etc/sendmail/Makefile and
release/Makefile:

diff -u etc/Makefile.orig etc/Makefile
--- etc/Makefile.orig	Fri Jul  9 04:10:12 1999
+++ etc/Makefile	Fri Jul 16 18:23:25 1999
@@ -60,7 +60,7 @@
 	( cd ${.CURDIR}/../gnu/libexec/uucp/sample; ${MAKE} install ); \
 	( cd ${.CURDIR}/../share/termcap; ${MAKE} etc-termcap ); \
 	( cd ${.CURDIR}/../usr.sbin/rmt; ${MAKE} etc-rmt ); \
-	( cd ${.CURDIR}/sendmail; ${MAKE} etc-sendmail.cf ); \
+	( cd ${.CURDIR}/sendmail; ${MAKE} install ); \
 	( cd ${.CURDIR}/isdn; ${MAKE} install );\
 	pwd_mkdb -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd; \
 	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 555 \

diff -u etc/sendmail/Makefile.orig etc/sendmail/Makefile
--- etc/sendmail/Makefile.orig	Tue Aug  4 10:53:18 1998
+++ etc/sendmail/Makefile	Sat Aug  7 17:32:37 1999
@@ -16,11 +16,12 @@
 	$(CHMOD) $(ROMODE) ${.TARGET}
 
 ALL=	freebsd.cf
+SENDMAIL_CF?= freebsd.cf
 
 # Local sendmail.cf, may be set in /etc/make.conf.  Warning! If set, this
 # causes 'make install' to always copy it over /etc/sendmail.cf!!!
 # Caveat emptor!  Be sure you want this before you enable it.
-.if defined(SENDMAIL_CF)
+.if defined(SENDMAIL_CF) && ${SENDMAIL_CF} != "freebsd.cf"
 ALL+=	${SENDMAIL_CF}
 .endif
 
@@ -30,15 +31,8 @@
 
 depend:
 
-install:
-.if defined(SENDMAIL_CF)
+install: ${SENDMAIL_CF}
 	${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m 644 ${SENDMAIL_CF} \
-		${DESTDIR}/etc/sendmail.cf
-.endif
-
-# Helper for src/etc/Makefile
-etc-sendmail.cf: freebsd.cf
-	${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m 644 freebsd.cf \
 		${DESTDIR}/etc/sendmail.cf
 
 # this is overkill, but....

diff -u release/Makefile.orig release/Makefile
--- release/Makefile.orig	Sat Aug  7 19:01:06 1999
+++ release/Makefile	Sat Aug  7 19:04:20 1999
@@ -130,6 +130,9 @@
 DOCREL= doc.1
 .endif
 
+# Name of the sendmail.cf file to include in the RELEASE
+RELEASE_CF?=freebsd.cf
+
 rerelease release:
 .if !defined(CHROOTDIR) || !defined(BUILDNAME) || !defined(CVSROOT)
 	@echo "To make a release you must set CHROOTDIR, BUILDNAME and CVSROOT" && false
@@ -144,7 +147,8 @@
 .endif
 	-mkdir -p ${CHROOTDIR}
 	cd ${.CURDIR}/../etc && ${MAKE} distrib-dirs DESTDIR=${CHROOTDIR}
-	cd ${.CURDIR}/../etc && ${MAKE} distribution DESTDIR=${CHROOTDIR}
+	cd ${.CURDIR}/../etc && ${MAKE} distribution DESTDIR=${CHROOTDIR} \
+		SENDMAIL_CF=${RELEASE_CF}
 	if [ -f /etc/resolv.conf ]; then \
 		cp -p /etc/resolv.conf ${CHROOTDIR}/etc; \
 	fi

>Release-Note:
>Audit-Trail:

From: Doug <Doug@gorean.org>
To: hetzels@westbend.net
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: conf/13016: Wrong sendmail.cf file used by mergemaster
Date: Sun, 08 Aug 1999 01:04:20 -0700

 "Scot W. Hetzel" wrote:
 
 > When using MergeMaster to update your /etc directory, it does a comparison
 > between the /var/tmp/temproot/etc/sendmail.cf(freebsd.cf) file and the
 > current /etc/sendmail.cf file. 
 
 	As I stated in my response to PR 12664 this is exactly what mergemaster is
 designed to do, therefore, your synopsis is incorrect. Please refer to that
 PR for several suggestions on ways to deal with this situation. 
 
 Good luck,
 
 Doug
 

From: "Scot W. Hetzel" <hetzels@westbend.net>
To: "Doug" <Doug@gorean.org>
Cc: <FreeBSD-gnats-submit@freebsd.org>
Subject: Re: conf/13016: Wrong sendmail.cf file used by mergemaster
Date: Mon, 9 Aug 1999 20:08:02 -0500

 From: Doug <Doug@gorean.org>
 > "Scot W. Hetzel" wrote:
 >
 > > When using MergeMaster to update your /etc directory, it does a
 comparison
 > > between the /var/tmp/temproot/etc/sendmail.cf(freebsd.cf) file and the
 > > current /etc/sendmail.cf file.
 >
 > As I stated in my response to PR 12664 this is exactly what mergemaster is
 > designed to do, therefore, your synopsis is incorrect. Please refer to
 that
 > PR for several suggestions on ways to deal with this situation.
 >
 I agree that this problem has nothing to do with the way mergemaster is
 designed to show how your installation differs from a default installation.
 (That's why I sent it to conf instead of ports).
 
   Instead it has to do with the way in which etc/sendmail/Makefile creates
 the sendmail.cf file in the ${DESTDIR}/etc directory.  This PR probably
 should have been called "Fix to sendmail.cf generation problem".
 
 Your suggestion in PR 12664, does not solve this problem.
 
 1. Delete sendmail.cf generation from etc/Makefile after updating sources
 and before using mergemaster.
 
 This will need to be done each time the sources are updated, and before
 mergemaster is used.  This is a waste of time, especially if the
 etc/sendmail/Makefile can be designed to create the correct sendmail.cf file
 when the SENDMAIL_CF variable is set in make.conf.
 
 2. After mergemaster makes the comparison between sendmail.cf files, just
 delete /var/tmp/tmproot/etc/sendmail.cf when asked.
 
 Before you are able to delete the sendmail.cf file from within mergemaster,
 you need to go through several screens of sendmail.cf comparisons before you
 are able to delete the sendmail.cf file in mergemaster.  This comparison is
 also useless when the system is using a custom sendmail.cf file.
 
 These two solutions do not fix the problem with the sendmail.cf and causes
 an inconvenience when using mergemaster to upgrade /etc from sources.
 
 The original patches, included with this PR,  solves the problem by using
 SENDMAIL_CF as follows:
 
 1. If SENDMAIL_CF is not defined in /etc/make.conf, then we default to using
 "freebsd.mc" to create the sendmail.cf file in ${DESTDIR}/etc.
 
 2. If SENDMAIL_CF is defined in /etc/make.conf, then we use the custom *.mc
 file to create the sendmail.cf file in ${DESTDIR}/etc.  This will also
 satisfy the complaints of mergemaster using the wrong sendmail.cf file in
 its comparisons.
 
 3. If were making a RELEASE and SENDMAIL_CF might be defined in make.conf,
 we ignore it, and instead use "freebsd.mc" to create the sendmail.cf file
 (SENDMAIL_CF gets set to ${RELEASE_CF} (RELEASE_CF=?freebsd.cf) in
 release/Makefile).
 
 And possibly a bonus:
 
 4. If RELEASE_CF is defined in /etc/make.conf, then we use the custom *.mc
 file to create a custom sendmail.cf file for our personal release build.
 
 Scot
 
 P.S. This PR should instead be forwarded to the maintainers of the
 etc/sendmail/Makefile in STABLE & CURRENT as that is where the problem is
 located. And not to the maintainer of the Mergemaster port.
 
 
 
 
 
 
 

From: Doug <Doug@gorean.org>
To: "Scot W. Hetzel" <hetzels@westbend.net>
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: conf/13016: Wrong sendmail.cf file used by mergemaster
Date: Tue, 10 Aug 1999 08:37:46 -0700

 "Scot W. Hetzel" wrote:
 
 > I agree that this problem has nothing to do with the way mergemaster is
 > designed to show how your installation differs from a default installation.
 
 	Ok, then next time don't mention it at all. It's not part of the base
 system, so it doesn't belong in a PR. 
 
 >   Instead it has to do with the way in which etc/sendmail/Makefile creates
 > the sendmail.cf file in the ${DESTDIR}/etc directory.  This PR probably
 > should have been called "Fix to sendmail.cf generation problem".
 
 	But there is no problem. You want to use a custom sendmail.cf file, go
 right ahead. That doesn't make the way the system works currently a
 "problem." It makes it inconvenient for you, an inconvenience that is
 easily dealt with.
  
 > Your suggestion in PR 12664, does not solve this problem.
 > 
 > 1. Delete sendmail.cf generation from etc/Makefile after updating sources
 > and before using mergemaster.
 > 
 > This will need to be done each time the sources are updated,
 
 	What I do for stuff like this is to 'cp Makefile makefile' then run a
 script before I do a make world which checks the cvs id's for all the
 makefiles I've customized to see if they have been updated. They hardly
 ever need to be. 
 
 > 2. After mergemaster makes the comparison between sendmail.cf files, just
 > delete /var/tmp/tmproot/etc/sendmail.cf when asked.
 > 
 > Before you are able to delete the sendmail.cf file from within mergemaster,
 > you need to go through several screens of sendmail.cf comparisons before you
 > are able to delete the sendmail.cf file in mergemaster.  This comparison is
 > also useless when the system is using a custom sendmail.cf file.
 
 	Oh please. Learn how to use your PAGER. On more and less all you have to
 do is hit q.
 
 	Personally I have no objections to the patches you are suggesting,
 providing that they actually work, do what you want them to do, etc.
 However I think that you're going way around the point with your arguments.
 My grandfather would say that you are using a five dollar solution for a
 twenty cent problem. I would tend to agree with him.
 
 Good luck,
 
 Doug
 
Responsible-Changed-From-To: freebsd-bugs->gshapiro 
Responsible-Changed-By: johan 
Responsible-Changed-When: Tue Sep 19 11:32:42 PDT 2000 
Responsible-Changed-Why:  
This is actually a sendmail config patch and we let 
out sendmail maintainer have a look at it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=13016 
State-Changed-From-To: open->feedback 
State-Changed-By: gshapiro 
State-Changed-When: Wed Feb 21 21:31:47 PST 2001 
State-Changed-Why:  
I've checked in changes to the HEAD such that mergemaster should get the 
proper sendmail.cf.  Unless I hear otherwise, I'll close this PR in the near 
future. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=13016 
State-Changed-From-To: feedback->closed 
State-Changed-By: gshapiro 
State-Changed-When: Tue Feb 27 18:56:46 PST 2001 
State-Changed-Why:  
The changes are now also in RELENG_4 (-STABLE). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=13016 
>Unformatted:
