[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#219156: marked as forwarded (texconfig script should use IFS safely)



Your message dated Fri, 09 Apr 2004 11:25:19 +0200
with message-id <87ptah33ls.fsf@alhambra.bioz.unibas.ch>
has caused the Debian Bug report #219156,
regarding texconfig script should use IFS safely
to be marked as having been forwarded to the upstream software
author(s) Thomas Esser <te@dbs.uni-hannover.de>.

(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 219156-forwarded) by bugs.debian.org; 9 Apr 2004 09:38:35 +0000
>From frank@kuesterei.ch Fri Apr 09 02:38:35 2004
Return-path: <frank@kuesterei.ch>
Received: from balu1.urz.unibas.ch [131.152.1.51] 
	by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
	id 1BBsT5-0007HT-00; Fri, 09 Apr 2004 02:38:35 -0700
Received: from alhambra.bioz.unibas.ch (bioz6-allgem17.Bioz.unibas.ch [131.152.17.45])
	by balu1.urz.unibas.ch (8.12.10/8.12.10) with ESMTP id i399c2we017676;
	Fri, 9 Apr 2004 11:38:02 +0200
Received: from localhost ([127.0.0.1] helo=alhambra.bioz.unibas.ch)
	by alhambra.bioz.unibas.ch with esmtp (Exim 3.35 #1 (Debian))
	id 1BBsGF-0000zX-00; Fri, 09 Apr 2004 11:25:19 +0200
To: Thomas Esser <te@dbs.uni-hannover.de>
Cc: 219156-forwarded@bugs.debian.org, michel.casabona@free.fr,
        Debian Bug
 Control Server <control@bugs.debian.org>
Subject: texconfig script should use IFS safely (was: Bug#219156: tetex-bin:
 postinst script fails to run texconfig under dash)
Reply-to: frank@kuesterei.ch
Sender: frank.kuester@unibas.ch
X-Attribution: fant
X-Ehrenamt: http://www.langau.de
From: frank@kuesterei.ch (=?iso-8859-1?q?Frank_K=FCster?=)
In-Reply-To: <20031121.154704.1723231967.kohda@pm.tokushima-u.ac.jp> (Atsuhito
 Kohda's message of "Fri, 21 Nov 2003 15:47:04 +0900 (JST)")
References: <87ad6tpzls.fsf@alhambra.bioz.unibas.ch>
	<1069252398.3fbb7f2eac7d6@imp3-l.free.fr>
	<871xs4458s.fsf@alhambra.bioz.unibas.ch>
	<20031121.154704.1723231967.kohda@pm.tokushima-u.ac.jp>
Date: Fri, 09 Apr 2004 11:25:19 +0200
Message-ID: <87ptah33ls.fsf@alhambra.bioz.unibas.ch>
User-Agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
Delivered-To: 219156-forwarded@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2004_03_25 
	(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-6.0 required=4.0 tests=BAYES_00,HAS_BUG_NUMBER,
	VALID_BTS_CONTROL autolearn=no version=2.60-bugs.debian.org_2004_03_25
X-Spam-Level: 
X-CrossAssassin-Scores: 2

retitle 219156 texconfig script should use IFS safely
thanks

Hi all,

this is a followup for a bug in Debian's tetex packages, which also is
relevant for upstream - hence Thomas get's a copy. First comes a short
explanation for people who forgot or never knew what it was all about,
then come some comments.

- The IFS variable is usually not exported to sub-processes, but there
  is no reason why this should be the case. Reading
  http://www.opengroup.org/onlinepubs/009696699/utilities/xcu_chap02.html#t=
ag_02_05_03
  might even suggest that it _should_ be exported. I couldn't find
  anything on that topic in http://www.opengroup.org/onlinepubs/7908799/
  which I usually use.

- Most shell implementation simply ignore IFS settings inherited from
  their parent (in accordance with the above link), but at least dash in
  the version shipped with Debian does respect it (also in accordance
  with the above link)

- In texconfig the variable envvars is initialized as follows:

envvars=3D"
AFMFONTS BIBINPUTS BSTINPUTS DVILJFONTS DVIPSFONTS DVIPSHEADERS GFFONTS
...

  thus starting with a newline. If IFS is ' ' (which can occur if
  /bin/sh links to /bin/dash, and IFS has been marked for export, as
  e.g. Eterm does) then the newline is part of the words in the
  variable, and one gets=20

+ found=3D
+ eval var=3D"$
AFMFONTS"
+ var=3D$
AFMFONTS
+ [ ! -z $
AFMFONTS ]
+ found=3D=20
AFMFONTS
+ eval var=3D"$BIBINPUTS"

  instead of=20

+ found=3D
+ eval 'var=3D"$AFMFONTS"'
++ var=3D
+ '[' '!' -z '' ']'
+ eval 'var=3D"$BIBINPUTS"'

  This caused a problem upon installation of our package. This
  particular problem is addressed below. But the bug will also occur if
  texconfig is called manually under similar circumstances.

  A simple fix would be to explicitly set IFS in texconfig (and perhaps
  in mktex.opt?), but I am not quite sure about this - one the one hand,
  this should be a general problem to many scripts, but hasn't been
  found often - is there a different way?. On the other hand, it only
  occurs under rare circumstances (e.g. /bin/sh --> dash inside Eterm),
  which might explain why it didn't show up.

  For these reasons I have retitled the bug and declared it as
  upstream.=20

So far to the upstream issues, here comes the Debian specific part:

Atsuhito Kohda <kohda@pm.tokushima-u.ac.jp> wrote:

> From: frank@kuesterei.ch (Frank K=FCster)
> Subject: Bug#219156: tetex-bin: postinst script fails to run texconfig un=
der dash
> Date: Wed, 19 Nov 2003 18:50:43 +0100
>
>> > Ok, I think I've caught the suspect. Looking in /proc/$PPID/environ and
>> > going back through the parents, I noticed that IFS is marked exportable
>> > by Eterm.
>>=20
>> Good to know where it came from...
>
> # So one sees the problem only on eterm?

Not really. The problem is triggered by eterm, because it changes
IFS. But any other program could do this, too - or the user in some
dotfile.=20

> Anyway, in short, the problem was basically in texconfig
> but we had a simple patch to our postinst which had no bad
> side effect.

We have this simple patch, but

- it wasn't applied somehow (will do that in a minute)

- it won't solve the problem under all circumstances, especially not
  when the user changed IFS in his/her environment before postinst is
  called=20

- the problem doesn't exist any more for our installation procedure,
  because we don't call texconfig any more.

Regards, Frank
--=20
Frank K=FCster, Biozentrum der Univ. Basel
Abt. Biophysikalische Chemie



Reply to: