Bug#651642: debconf: process_command does not properly skip blank input lines.

December 10th, 2011 - 03:30 pm ET by Bob Vincent | Report spam

Package: debconf
Version: 1.5.40ubuntu1
Severity: normal

This is related to 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}) {


Debian Release: wheezy/sid
APT prefers oneiric-updates
APT policy: (500, 'oneiric-updates'), (500, 'oneiric'), (100, 'oneiric-backports')
Architecture: i386 (i686)

Kernel: Linux 3.2.0-rc5+ (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to en_US.UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages debconf depends on:
ii perl-base 5.12.4-4 minimal Perl system

Versions of packages debconf recommends:
ii apt-utils 0.8.16~exp5ubuntu13 APT utility programs
ii debconf-i18n 1.5.40ubuntu1 full internationalization support

Versions of packages debconf suggests:
pn debconf-doc <none> (no description available)
ii debconf-utils 1.5.40ubuntu1 debconf utilities
ii dialog 1.1-20110707-1 Displays user-friendly dialog boxe
ii libgtk2-perl 2:1.223-1build2 Perl interface to the 2.x series o
pn libnet-ldap-perl <none> (no description available)
pn libqtcore4-perl <none> (no description available)
pn libqtgui4-perl <none> (no description available)
pn libterm-readline-gnu-pe <none> (no description available)
ii perl 5.12.4-4 Larry Wall's Practical Extraction
ii whiptail 0.52.11-2ubuntu8 Displays user-friendly dialog boxe

debconf-apt-progress/title:
debconf-apt-progress/info:
debconf/priority: high
debconf-apt-progress/preparing:
debconf-apt-progress/media-change:
* debconf/frontend: Dialog


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}) {




To UNSUBSCRIBE, email to debian-bugs-dist-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
email Follow the discussionReplies 1 replyReplies Make a reply

Similar topics

Replies

#1 Joey Hess
December 10th, 2011 - 04:40 pm ET | Report spam

Bob Vincent wrote:
This is related to 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:



It would help if those bug reports included DEBCONF_DEBUG=.
protocol dumps so we could see why blank lines were being sent to
debconf. It seems likely that the packages are doing something wrong to
screw up the protocol like this.

The protocol has no provision for either blank lines or comments; the
reason for the code above is unclear (it was introduced when the thing
was first written in 1999). Debconf seems to do the right thing
protocol-wise by responding with an error to both -- I've gotten rid of
the uninitialized value warning.

see shy jo






To UNSUBSCRIBE, email to
with a subject of "unsubscribe". Trouble? Contact
email Follow the discussion Replies Reply to this message
Help Create a new topicReplies Make a reply
Search Make your own search