Bug#53320: marked as done (ppd-gs: shell scripting bugs in update-ppd and install-ppd)
Your message dated Tue, 21 Mar 2000 18:10:28 +0100
with message-id <20000321181028.A3553@k6.resI.insa-lyon.fr>
and subject line Closing bug marked as fixed for debian-qa
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.)
Darren Benham
(administrator, Debian Bugs database)
--------------------------------------
Received: (at submit) by bugs.debian.org; 23 Dec 1999 01:00:10 +0000
Received: (qmail 1497 invoked from network); 23 Dec 1999 01:00:09 -0000
Received: from blood-axp.eradicator.org (mail@209.151.20.194)
by master.debian.org with SMTP; 23 Dec 1999 01:00:09 -0000
Received: from dhd by blood-axp.eradicator.org with local (Exim 3.03 #1 (Debian))
id 120wbt-0004J9-00; Wed, 22 Dec 1999 20:00:05 -0500
From: dhd <dhd@eradicator.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: ppd-gs: shell scripting bugs in update-ppd and install-ppd
X-Reportbug-Version: 0.45
X-Mailer: reportbug 0.45
Date: Wed, 22 Dec 1999 20:00:05 -0500
Message-Id: <E120wbt-0004J9-00@blood-axp.eradicator.org>
Package: ppd-gs
Version: 1.1-1.1
Severity: normal
There are many shell scripting errors in update-ppd and install-ppd.
update-ppd in particular basically doesn't work, particularly if you use ash
rather than bash as your shell (it is *not* legal to use 'trap' with no list
of signals in ash - use 'trap "foo" 0' instead).
Also tempfiles are being created in a rather insecure manner.
Finally I don't see why you write your own 'which' and 'dirname' since they
are part of required packages. Particularly when they don't work right (the
'set - $PATH' construct does not work in current bash or ash, in fact I
wonder if it ever did).
Here are some patches that should fix most of the problems:
--- update-ppd.orig Wed Dec 22 19:51:58 1999
+++ update-ppd Wed Dec 22 19:52:16 1999
@@ -4,22 +4,6 @@
#
# Yves Arrouye <Yves.Arrouye@marin.fdn.fr>, 1996
-which() {
- prog=$1
- save_ifs="$IFS"; IFS=:
- set - ..:$PATH
- for d
- do
- if [ -x $d/$prog ]
- then
- echo $d/$prog
- break
- fi
- done
- IFS="$save_ifs"
- unset save_ifs prog
-}
-
# Please 2>/dev/null your calls to the listppd function.
listppd() {
@@ -52,8 +36,6 @@
me=`basename $0`
-trap "rm -f /tmp/$me.$$.updt"
-
usage() {
>&2 echo usage: "$me [ -v, --verbose ] [ -i, --interactive ] [ --dontlocalize ] [ --iff-gs ] [ --iff-writable ] [ -a, --any-ppd ] [ -g, --gs-ppd ] [ -n, --nongs-ppd ] [ -b, --bg-update ] [ --signature sig ] [ -d, --destdir directory ] [ ppd-file ... ]"
exit 1
@@ -249,7 +231,7 @@
then
echon "Locating installed PPD files... "
fi
- ppdfiles=`2>/dev/null listppd`
+ ppdfiles=`listppd 2>/dev/null`
if [ ! -z "$interactive" ]
then
echo done
@@ -292,6 +274,8 @@
if [ ! -z "$ppdfiles" ]
then
+ tempfile=`tempfile --prefix ppdgs --suffix .updt`
+ trap "rm -f $tempfile" 1 2 8 13 14 15
if [ ! -z "$interactive" ]
then
yorn y 'Would you like to adapt your PPD files to your installation?'
@@ -328,11 +312,12 @@
then
if [ ! -z "$mail" ]
then
+ trap "rm -f $tempfile" 0
errlogexpl="you will receive a mail if there are some errors
during the update"
else
errlogexpl="a log of errors occuring during the update will be
-available as \`/tmp/$me.$$.updt'."
+available as \`$tempfile'"
fi
yorn $background "The adaptation of the PPD files may take some time. Do you want it to be
run in the backgound ($errlogexpl)?" 'Background update of PPD files?'
@@ -342,23 +327,21 @@
then
(
install-ppd $iopts $gsopts $ppdfiles \
- >/dev/null 2>/tmp/$me.$$.updt;
- if [ -s /tmp/$me.$$.updt ]
+ >/dev/null 2>$tempfile
+ if [ -s $tempfile ]
then
if [ ! -z "$mail" ]
then
- cat <<EOM | $mail \
- -s 'Messages during PPD files adaptation' `whoami`
+ $mail -s 'Messages during PPD files adaptation' `whoami` <<EOF
The adaptation of your PPD files yielded the following messages:
-`cat /tmp/$me.$$.updt`
+`cat $tempfile`
Hope these messages are clear enough...
$signature
-EOM
+EOF
fi
fi
- rm -f /tmp/$me.$$.updt
) &
if [ ! -z "$interactive" ]
then
--- install-ppd.orig Wed Dec 22 19:51:50 1999
+++ install-ppd Wed Dec 22 19:57:09 1999
@@ -21,11 +21,11 @@
me=`basename $0`
-sedscript=/tmp/$me.$$.sed
-psfile=/tmp/$me.$$.ps
-tmpdest=/tmp/$me.$$.tmp
+sedscript=`tempfile --prefix insgs --suffix .sed`
+psfile=`tempfile --prefix insgs --suffix .ps`
+tmpdest=`tempfile --prefix insgs --suffix .tmp`
-trap "rm -f $sedscript $psfile $tmpdest; >&2 echo Interrupted..."
+trap "rm -f $sedscript $psfile $tmpdest; >&2 echo Interrupted... " 1 2 8 13 14 15
usage() {
>&2 echo "usage: $me [ --dontlocalize ] [ --dontchange ] [ -l, --locales localespath ] [ -v, --verbose ] [ -p, --paper papersize ] [ -t, --testdir test-dir ] [ -d, --destdir install-dir ] ppd-file ..."
@@ -79,34 +79,6 @@
usage
fi
-#
-
-which() {
- prog=$1
- save_ifs="$IFS"; IFS=:
- set - ..:$PATH
- for d
- do
- if [ -f $d/$prog ]
- then
- echo $d/$prog
- break
- fi
- done
- IFS="$save_ifs"
- unset save_ifs prog
-}
-
-dirname() {
- _dir=`echo $1 | sed 's,/[^/]*$,,'`
- if [ "$_dir" = "$1" ]
- then
- echo .
- else
- echo $_dir
- fi
-}
-
makeppddirs() {
mkppddir=`which mkppddir`
@@ -264,7 +236,7 @@
}
-papersize_gs=/tmp/$me.$$.ps
+papersize_gs=`tempfile --prefix=insps --suffix=.ps`
gspapersize() {
if [ ! -f $papersize_gs ]
@@ -926,4 +898,3 @@
makeppddirs
rm -f $sedscript $psfile $tmpdest
-
-- System Information
Debian Release: potato
Architecture: alpha
Kernel: Linux blood-axp.eradicator.org 2.2.14pre12 #1 Fri Dec 10 15:59:26 EST 1999 alpha
---------------------------------------
Received: (at 53320-done) by bugs.debian.org; 21 Mar 2000 17:10:59 +0000
Received: (qmail 30254 invoked from network); 21 Mar 2000 17:10:41 -0000
Received: from i511.resi.insa-lyon.fr (HELO k6.resI.insa-lyon.fr) (134.214.164.9)
by master.debian.org with SMTP; 21 Mar 2000 17:10:41 -0000
Received: by k6.resI.insa-lyon.fr (Postfix, from userid 1001)
id 734074045; Tue, 21 Mar 2000 18:10:28 +0100 (CET)
Message-ID: <20000321181028.A3553@k6.resI.insa-lyon.fr>
Date: Tue, 21 Mar 2000 18:10:28 +0100
From: Raphael Hertzog <rhertzog@hrnet.fr>
To: 13004-done@bugs.debian.org, 14927-done@bugs.debian.org,
20443-done@bugs.debian.org, 21121-done@bugs.debian.org,
21773-done@bugs.debian.org, 22526-done@bugs.debian.org,
23059-done@bugs.debian.org, 28968-done@bugs.debian.org,
41973-done@bugs.debian.org, 49264-done@bugs.debian.org,
53178-done@bugs.debian.org, 18876-done@bugs.debian.org,
26751-done@bugs.debian.org, 29891-done@bugs.debian.org,
34184-done@bugs.debian.org, 40511-done@bugs.debian.org,
42190-done@bugs.debian.org, 47097-done@bugs.debian.org,
51305-done@bugs.debian.org, 53320-done@bugs.debian.org,
53365-done@bugs.debian.org, 55260-done@bugs.debian.org,
55933-done@bugs.debian.org, 56460-done@bugs.debian.org,
59605-done@bugs.debian.org
Subject: Closing bug marked as fixed for debian-qa
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-15
Content-Transfer-Encoding: 8bit
X-Mailer: Mutt 0.93i
I'm closing all those bugs since they are marked as fixed and the
maintainer responsible is debian-qa ...
Cheers,
--
Raphaël Hertzog >> 0C4CABF1 >> http://tux.u-strasbg.fr/~raphael/
<pub> CD Debian : http://tux.u-strasbg.fr/~raphael/debian/#cd
Formations Linux et logiciels libres : http://www.logidee.com </pub>
Reply to: