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

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 <E1DQPTG-0004jw-00@newraff.debian.org>
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 jvmatl@mindspring.com Mon Feb 11 23:28:03 2002
Return-path: <jvmatl@mindspring.com>
Received: from holt.mail.mindspring.net (holt.mail.atl.earthlink.net) [207.69.200.187] 
	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 ([207.69.200.127])
	by holt.mail.atl.earthlink.net with esmtp (Exim 3.33 #1)
	id 16aVU1-0002M7-00
	for submit@bugs.debian.org; 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
From: <jvmatl@mindspring.com>
To: submit@bugs.debian.org
Subject: x10.postinst script has backwards logic on tty detection, unreachable code.
Sender: jvmatl@mindspring.com
Message-ID: <Springmail.105.1013491680.0.37561600@www.springmail.com>
X-Originating-IP: 65.185.215.129
Delivered-To: submit@bugs.debian.org

Package: x10
Version: 1.06-7

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."
33:  else 
34:      ln -sf "$serial" /dev/x10 && exit 0
35:      echo "Failed to link to $serial to /dev/x10."
36:  fi

Clearly, line 31 was intended to read:
31': if [ ! -e "$serial" ] ; then


Bug 2)

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.)

Cheers,

-(-- John V. Martinez


---------------------------------------
Received: (at 133519-close) by bugs.debian.org; 26 Apr 2005 12:52:08 +0000
>From katie@ftp-master.debian.org Tue Apr 26 05:52:08 2005
Return-path: <katie@ftp-master.debian.org>
Received: from newraff.debian.org [208.185.25.31] (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 <vela@debian.org>
To: 133519-close@bugs.debian.org
X-Katie: $Revision: 1.55 $
Subject: Bug#133519: fixed in x10 1.06-9
Message-Id: <E1DQPTG-0004jw-00@newraff.debian.org>
Sender: Archive Administrator <katie@ftp-master.debian.org>
Date: Tue, 26 Apr 2005 08:47:22 -0400
Delivered-To: 133519-close@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=-6.0 required=4.0 tests=BAYES_00,HAS_BUG_NUMBER 
	autolearn=no version=2.60-bugs.debian.org_2005_01_02
X-Spam-Level: 

Source: x10
Source-Version: 1.06-9

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:

x10_1.06-9.diff.gz
  to pool/main/x/x10/x10_1.06-9.diff.gz
x10_1.06-9.dsc
  to pool/main/x/x10/x10_1.06-9.dsc
x10_1.06-9_i386.deb
  to pool/main/x/x10/x10_1.06-9_i386.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 133519@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Matej Vela <vela@debian.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 ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Tue, 26 Apr 2005 14:23:12 +0200
Source: x10
Binary: x10
Architecture: source i386
Version: 1.06-9
Distribution: unstable
Urgency: low
Maintainer: Debian QA Group <packages@qa.debian.org>
Changed-By: Matej Vela <vela@debian.org>
Description: 
 x10        - Operate X-10 electrical power control modules
Closes: 133519 294417
Changes: 
 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.
Files: 
 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)

iD8DBQFCbjK/xBYivKllgY8RAplXAJ9DB86f1+d8PSG1igAW8JZgATyflQCfYtKh
aJXcDhVLAKGrQMhX5Dm3iQk=
=+Hpe
-----END PGP SIGNATURE-----



Reply to: