Bug#305957: marked as done (Postinstall script replaces configuration escape sequences with their expansions on upgrade)

Debian Bug Tracking System owner@bugs.debian.org
Sun, 05 Jun 2005 22:33:19 -0700


Your message dated Mon, 6 Jun 2005 07:28:45 +0200
with message-id <20050606052845.GA936@lefler.int.l21.ma.zugschlus.de>
and subject line exim4 4.50-8 in sarge fixes these bugs
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 23 Apr 2005 05:35:50 +0000
>From b.kitson@ieee.org Fri Apr 22 22:35:50 2005
Return-path: <b.kitson@ieee.org>
Received: from gizmo06ps.bigpond.com [144.140.71.41] 
	by spohr.debian.org with smtp (Exim 3.35 1 (Debian))
	id 1DPDJ0-00040b-00; Fri, 22 Apr 2005 22:35:50 -0700
Received: (qmail 28401 invoked from network); 23 Apr 2005 05:35:17 -0000
Received: from unknown (HELO psmam11.bigpond.com) (144.135.25.100)
  by gizmo06ps.bigpond.com with SMTP; 23 Apr 2005 05:35:17 -0000
Received: from cpe-60-226-20-221.qld.bigpond.net.au ([60.226.20.221]) by psmam11.bigpond.com(MAM REL_3_4_2a 225/59312758) with SMTP id 59312758; Sat, 23 Apr 2005 15:35:17 +1000
Received: from [192.168.1.12] (helo=dangun.glencairn.bogus)
	by glencairn.bpa.nu with esmtp (Exim 4.50)
	id 1DPDIS-0003Py-OE
	for submit@bugs.debian.org; Sat, 23 Apr 2005 15:35:16 +1000
Received: from localhost ([127.0.0.1] helo=dangun.glencairn.bogus)
	by dangun.glencairn.bogus with esmtp (Exim 4.50)
	id 1DPCyz-0003pP-Gl
	for submit@bugs.debian.org; Sat, 23 Apr 2005 15:15:09 +1000
Subject: Postinstall script replaces configuration escape sequences with
	their expansions on upgrade
From: Barry Kitson <b.kitson@ieee.org>
To: submit@bugs.debian.org
Content-Type: multipart/mixed; boundary="=-lWVak5qCFPb0qr/UzmFg"
Date: Sat, 23 Apr 2005 15:15:08 +1000
Message-Id: <1114233308.10507.32.camel@dangun.glencairn.bogus>
Mime-Version: 1.0
X-Mailer: Evolution 2.2.2 
Delivered-To: submit@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 
	(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-8.0 required=4.0 tests=BAYES_00,HAS_PACKAGE 
	autolearn=no version=2.60-bugs.debian.org_2005_01_02
X-Spam-Level: 


--=-lWVak5qCFPb0qr/UzmFg
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Package: exim4-config
Version: 4.50-6

When upgrading any recent version of the exim4 package, the exim4-config
postinst script tries to update /etc/exim4/update-exim4.conf.conf
configuration file automagically.  This configuration file is used (by
update-exim4.conf) to dynamically create a new exim configuration file
(/var/lib/exim4/config.autogenerated) from templates
(/etc/exim4/exim4.conf.template or /etc/exim4/conf.d).

All appears to work if the configuration variables (ie environment
variables) in etc/exim4/update-exim4.conf.conf do not contained escape
sequences.  If they do they will be replaced with their expansion.  A
result can be that the exim configuration is fatally corrupted.

For example, a configuration in /etc/exim4/update-exim4.conf.conf
such as...
dc_relay_domains='*.some.net.somewhere:\\N^[^.]*$'
will be re-written (after upgrading exim4) as ...
dc_relay_domains='*.some.net.somewhere:\N^[^.]*$'

This change in the configuration is clearly not intended.  (The result
in the example above is that exim stops sending mail and resolving
addresses.)

A patch fixing the problem is attached...

Regards,

	Barry.

-- 
Barry Kitson <b.kitson@ieee.org>

--=-lWVak5qCFPb0qr/UzmFg
Content-Disposition: attachment; filename=exim4.config.patch
Content-Type: text/x-patch; name=exim4.config.patch; charset=ANSI_X3.4-1968
Content-Transfer-Encoding: quoted-printable

diff -Naur exim4-4.50.old/debian/exim4-config.postinst exim4-4.50/debian/ex=
im4-config.postinst
--- exim4-4.50.old/debian/exim4-config.postinst	2005-04-23 14:54:29.7011221=
99 +1000
+++ exim4-4.50/debian/exim4-config.postinst	2005-04-23 14:56:45.164653443 +=
1000
@@ -283,22 +283,38 @@
 			echo "${variable}=3D''" >> $UE4CC
 		fi
 	done
+
 	# insert new values, remove outdated ones.
-	sed -e "s=C4^[[:space:]]*dc_eximconfig_configtype=3D.*=C4dc_eximconfig_co=
nfigtype=3D'${dc_eximconfig_configtype}'=C4" \
-	-e "s=C4^[[:space:]]*dc_local_interfaces=3D.*=C4dc_local_interfaces=3D'${=
dc_local_interfaces}'=C4" \
-	-e "s=C4^[[:space:]]*dc_other_hostnames=3D.*=C4dc_other_hostnames=3D'${dc=
_other_hostnames}'=C4" \
-	-e "s=C4^[[:space:]]*dc_readhost=3D.*=C4dc_readhost=3D'${dc_readhost}'=C4=
" \
-	-e "s=C4^[[:space:]]*dc_relay_domains=3D.*=C4dc_relay_domains=3D'${dc_rel=
ay_domains}'=C4" \
-	-e "s=C4^[[:space:]]*dc_relay_nets=3D.*=C4dc_relay_nets=3D'${dc_relay_net=
s}'=C4" \
-	-e "s=C4^[[:space:]]*dc_smarthost=3D.*=C4dc_smarthost=3D'${dc_smarthost}'=
=C4" \
-	-e "s=C4^[[:space:]]*dc_minimaldns=3D.*=C4dc_minimaldns=3D'${dc_minimaldn=
s}'=C4" \
-	-e "s=C4^[[:space:]]*CFILEMODE=3D.*=C4CFILEMODE=3D'${CFILEMODE}'=C4" \
-	-e "s=C4^[[:space:]]*dc_never_users=3D.*=C4=C4" \
-	-e "s=C4^[[:space:]]*dc_use_split_config=3D.*=C4dc_use_split_config=3D'${=
dc_use_split_config}'=C4" \
-	-e "s=C4^[[:space:]]*dc_hide_mailname=3D.*=C4dc_hide_mailname=3D'${dc_hid=
e_mailname}'=C4" \
-	-e "s=C4^[[:space:]]*dc_mailname_in_oh=3D.*=C4dc_mailname_in_oh=3D'${dc_m=
ailname_in_oh}'=C4" \
-	< $UE4CC \
-	> ${UE4CC}.tmp
+
+	# Use environment variables to communicate data to awk, to
+	# avoid shell (or awk or sed) string expansion which may
+	# expand escape sequences.  Note that the variables named in
+	# ${dc_directives} (but not the variable names themselves) may
+	# contain escaped characters. =20
+
+	export dc_directives ${dc_directives}
+
+	awk '
+            BEGIN {
+                split( ENVIRON["dc_directives"], directives, "[[:space:]]"=
 );
+            }
+            {
+                written =3D 0;
+                for ( i in directives )
+                   {
+                       regex =3D "^[[:space:]]*" directives[i] "=3D";
+                       if ( ( $0 ~ regex ) && ( ! written ) )
+                           {
+                               # Add single quotes (\0x27) around the valu=
e.
+                               print directives[i] "=3D\x27" ENVIRON[direc=
tives[i]] "\x27";
+                               written =3D 1;
+                               break;
+                           }
+                   }
+                   if ( ! written )
+                       print $0;
+            }' < ${UE4CC} > ${UE4CC}.tmp
+
 	mv ${UE4CC}.tmp $UE4CC
=20
 	echo $mailname > /etc/mailname

--=-lWVak5qCFPb0qr/UzmFg--


---------------------------------------
Received: (at 305957-done) by bugs.debian.org; 6 Jun 2005 05:28:55 +0000
>From mh+debian-packages@zugschlus.de Sun Jun 05 22:28:54 2005
Return-path: <mh+debian-packages@zugschlus.de>
Received: from 5301d.unt0.torres.l21.ma.zugschlus.de (torres.int.l21.ma.zugschlus.de) [217.151.83.1] (Debian-exim)
	by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
	id 1DfAAQ-0006v9-00; Sun, 05 Jun 2005 22:28:54 -0700
Received: from lefler.int.l21.ma.zugschlus.de ([192.168.130.38])
	by torres.int.l21.ma.zugschlus.de with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32)
	(Exim 4.50)
	id 1DfAAN-0000y5-Vo; Mon, 06 Jun 2005 07:28:52 +0200
Received: from mh by lefler.int.l21.ma.zugschlus.de with local (Exim 4.50)
	id 1DfAAH-0000FT-LO; Mon, 06 Jun 2005 07:28:45 +0200
Date: Mon, 6 Jun 2005 07:28:45 +0200
From: Marc Haber <mh+debian-packages@zugschlus.de>
To: 304838-done@bugs.debian.org, 304838-submitter@bugs.debian.org,
	310703-done@bugs.debian.org, 310703-submitter@bugs.debian.org,
	305957-done@bugs.debian.org, 305957-submitter@bugs.debian.org,
	305443-done@bugs.debian.org, 305443-submitter@bugs.debian.org,
	310118-done@bugs.debian.org, 310118-submitter@bugs.debian.org,
	307370-done@bugs.debian.org, 307370-submitter@bugs.debian.org,
	306094-done@bugs.debian.org, 306094-submitter@bugs.debian.org,
	306613-done@bugs.debian.org, 306613-submitter@bugs.debian.org,
	306349-done@bugs.debian.org, 306349-submitter@bugs.debian.org,
	306970-done@bugs.debian.org, 306970-submitter@bugs.debian.org,
	310057-done@bugs.debian.org, 310057-submitter@bugs.debian.org,
	299743-done@bugs.debian.org, 299743-submitter@bugs.debian.org,
	309174-done@bugs.debian.org, 309174-submitter@bugs.debian.org
Cc: Marc Haber <mh+debian-packages@zugschlus.de>
Subject: exim4 4.50-8 in sarge fixes these bugs
Message-ID: <20050606052845.GA936@lefler.int.l21.ma.zugschlus.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.5.9i
Delivered-To: 305957-done@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 
	(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-3.0 required=4.0 tests=BAYES_00 autolearn=no 
	version=2.60-bugs.debian.org_2005_01_02
X-Spam-Level: 
X-CrossAssassin-Score: 4

Hi,

with the release team's kind approval, exim4 4.50-8 was accepted for
sarge, and thus the bugs listed in the To: header are finally finally
fixed.

Greetings
Marc

-- 
-----------------------------------------------------------------------------
Marc Haber         | "I don't trust Computers. They | Mailadresse im Header
Mannheim, Germany  |  lose things."    Winona Ryder | Fon: *49 621 72739834
Nordisch by Nature |  How to make an American Quilt | Fax: *49 621 72739835