process_command does not properly skip blank input lines

Bug #902624 reported by Bob Vincent
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
debconf (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Upstream bug report filed at http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=651642

This is related to Debian bug reports #630772 and #637737

When purging old kernels from the command line, multiple "Use of uninitialized value $command" errors are displayed. These errors are caused by the following code line:

      return 1 unless defined && ! /^\s*#/; # Skip blank lines, comments.

The code skips undefined input and comments, but the associated inline comment claims that the intent was to skip blank lines and comments. I resolved the problem locally by making the following change:

diff --git a/Debconf/ConfModule.pm b/Debconf/ConfModule.pm
index 8017202..20c084e 100644
--- a/Debconf/ConfModule.pm
+++ b/Debconf/ConfModule.pm
@@ -228,7 +228,9 @@ sub process_command {
  my $this=shift;

  debug developer => "<-- $_";
- return 1 unless defined && ! /^\s*#/; # Skip blank lines, comments.
+ return 1 unless defined; # Skip empty input.
+ return 1 if /^\s*$/ # Skip blank lines.
+ return 1 if /^\s*#/ # Skip comments.
  chomp;
  my ($command, @params);
  if (defined $this->client_capb and grep { $_ eq 'escape' } @{$this->client_capb}) {

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: debconf 1.5.40ubuntu1 [modified: usr/share/perl5/Debconf/ConfModule.pm]
Uname: Linux 3.2.0-rc5+ i686
ApportVersion: 1.23-0ubuntu4
Architecture: i386
Date: Sat Dec 10 15:18:59 2011
InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Alpha i386 (20100712)
ProcEnviron:
 LANGUAGE=en_US.UTF-8
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: debconf
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Bob Vincent (pillarsdotnet) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "debconf-process_command.diff" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-reviewers team please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
Revision history for this message
dino99 (9d9) wrote :

was fixed into debconf 1.5.42

Changed in debconf (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.