Bug#133519: marked as done (x10.postinst script has backwards logic on tty detection, unreachable code.)
Your message dated Tue, 26 Apr 2005 08:47:22 -0400
with message-id <E1DQPTGemail@example.com>
and subject line Bug#133519: fixed in x10 1.06-9
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; 12 Feb 2002 05:28:03 +0000
>From firstname.lastname@example.org Mon Feb 11 23:28:03 2002
Received: from holt.mail.mindspring.net (holt.mail.atl.earthlink.net) [126.96.36.199]
by master.debian.org with esmtp (Exim 3.12 1 (Debian))
id 16aVU3-0001Sa-00; Mon, 11 Feb 2002 23:28:03 -0600
Received: from smui08.eng00.mindspring.net ([188.8.131.52])
by holt.mail.atl.earthlink.net with esmtp (Exim 3.33 #1)
for email@example.com; Tue, 12 Feb 2002 00:28:01 -0500
Received: by smui08.eng00.mindspring.net id AAA0000011770; Tue, 12 Feb 2002 00:28:00 -0500 (EST)
Date: Tue, 12 Feb 2002 00:28:00 -0500
Subject: x10.postinst script has backwards logic on tty detection, unreachable code.
Two shell scripting bugs related to x10.postinst:
Bug 1) I was installing the x10 package for the first time and I encountered the very frustrating situation that the post-install script kept telling me that my serial device "/dev/ttyS0" did not exist, when 'ls' insisted the device node was, in fact, there.
When I investigated, I found that the x10.postinst script has backwards logic on line 31. Since the bug in question is only triggered if the /dev/x10 symlink is not already present, an existing x10 user would be unlikely to run across the problem. :^)
The code reads:
31: if [ -e "$serial" ] ; then
31: echo "$serial does not exist."
34: ln -sf "$serial" /dev/x10 && exit 0
35: echo "Failed to link to $serial to /dev/x10."
Clearly, line 31 was intended to read:
31': if [ ! -e "$serial" ] ; then
A second, but related problem with the script logic also became apparent on inspection: Even if Bug #1 is fixed; If the /dev/x10 link does not already pre-exist when the script is run, (i.e. as is the case on an initial x10 install), then the last block of code (which creates the symlink from /usr/doc/x10 to /usr/share/doc/x10) will not get executed, because of the "exit 0" on the success path on line 34, and so the documentation will not be visible at /usr/doc/x10.
This can be fixed by replacing the 'exit 0' statements on lines 29 and 35 with a less-drastic-but-still-effective 'break' to get out of the input loop. (Using exits in this sort of script is a bad habit anyway, IMHO - makes it harder to tack on extra bits of logic at the end without having to rething the whole script.)
WARNING! This may be a systematic bug in a number of post-install scripts: The final code block has a comment above it that says
# symlink management generated by debstd
I'm not sure exactly what this means: was this changed by a person? an organization? a script that modified a whole slew of post-install scripts to effect a policy change? It smells of auto-generated code, and if so, there may be more scripts out there with the same kind of bug. (i.e. exiting before the final block executes.)
-(-- John V. Martinez
Received: (at 133519-close) by bugs.debian.org; 26 Apr 2005 12:52:08 +0000
>From firstname.lastname@example.org Tue Apr 26 05:52:08 2005
Received: from newraff.debian.org [184.108.40.206] (mail)
by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
id 1DQPXs-0007GF-00; Tue, 26 Apr 2005 05:52:08 -0700
Received: from katie by newraff.debian.org with local (Exim 3.35 1 (Debian))
id 1DQPTG-0004jw-00; Tue, 26 Apr 2005 08:47:22 -0400
From: Matej Vela <email@example.com>
X-Katie: $Revision: 1.55 $
Subject: Bug#133519: fixed in x10 1.06-9
Sender: Archive Administrator <firstname.lastname@example.org>
Date: Tue, 26 Apr 2005 08:47:22 -0400
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=-6.0 required=4.0 tests=BAYES_00,HAS_BUG_NUMBER
We believe that the bug you reported is fixed in the latest version of
x10, which is due to be installed in the Debian FTP archive:
A summary of the changes between this version and the previous one is
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to email@example.com,
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
Matej Vela <firstname.lastname@example.org> (supplier of updated x10 package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing email@example.com)
-----BEGIN PGP SIGNED MESSAGE-----
Date: Tue, 26 Apr 2005 14:23:12 +0200
Architecture: source i386
Maintainer: Debian QA Group <firstname.lastname@example.org>
Changed-By: Matej Vela <email@example.com>
x10 - Operate X-10 electrical power control modules
Closes: 133519 294417
x10 (1.06-9) unstable; urgency=low
* QA upload.
* Fix symlink creation logic. Closes: #133519.
* Prompt via debconf. Closes: #294417.
* debian/postrm: Remove /dev/x10 on purge.
* debian/README.debian: Fold into debian/copyright.
4351ce8188f546acb60c6011fd42a5b5 544 electronics optional x10_1.06-9.dsc
d87716c0341ab2d0be96c67956343695 7103 electronics optional x10_1.06-9.diff.gz
4c74d078f5ed7bd5557383747fc8dd3c 20952 electronics optional x10_1.06-9_i386.deb
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
-----END PGP SIGNATURE-----