Package: debconf
Version: 1.5.50
Severity: important
Tags: patch
Dear Maintainer,
I received the following "Use of unitialized value in concatentation"
error when I tried to upgrade/install any package.
root@bishop:~# apt-get install --reinstall nmap
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
libgtk2-ruby
Use 'apt-get autoremove' to remove it.
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 2 not upgraded.
Need to get 0 B/4,003 kB of archives.
After this operation, 0 B of additional disk space will be used.
Use of uninitialized value in concatenation (.) or string at
/usr/share/perl5/Debconf/DbDriver/File.pm line 44, <DEBCONF_CONFIG> chunk 3.
Use of uninitialized value in -e at /usr/share/perl5/Debconf/DbDriver/File.pm
line 46, <DEBCONF_CONFIG> chunk 3.
Use of uninitialized value in pattern match (m//) at
/usr/share/perl5/Debconf/DbDriver/File.pm line 47, <DEBCONF_CONFIG> chunk 3.
Use of uninitialized value $directory in -d at
/usr/share/perl5/Debconf/DbDriver/File.pm line 48, <DEBCONF_CONFIG> chunk 3.
Use of uninitialized value $directory in concatenation (.) or string at
/usr/share/perl5/Debconf/DbDriver/File.pm line 49, <DEBCONF_CONFIG> chunk 3.
debconf: DbDriver "config": mkdir :No such file or directory
(Reading database ... 340051 files and directories currently installed.)
Preparing to replace nmap 6.25-0.1 (using .../nmap_6.25-0.1_amd64.deb) ...
Unpacking replacement nmap ...
Processing triggers for man-db ...
Use of uninitialized value in concatenation (.) or string at
/usr/share/perl5/Debconf/DbDriver/File.pm line 44, <DEBCONF_CONFIG> chunk 3.
Use of uninitialized value in -e at /usr/share/perl5/Debconf/DbDriver/File.pm
line 46, <DEBCONF_CONFIG> chunk 3.
Use of uninitialized value in pattern match (m//) at
/usr/share/perl5/Debconf/DbDriver/File.pm line 47, <DEBCONF_CONFIG> chunk 3.
Use of uninitialized value $directory in -d at
/usr/share/perl5/Debconf/DbDriver/File.pm line 48, <DEBCONF_CONFIG> chunk 3.
Use of uninitialized value $directory in concatenation (.) or string at
/usr/share/perl5/Debconf/DbDriver/File.pm line 49, <DEBCONF_CONFIG> chunk 3.
debconf: DbDriver "config": mkdir :No such file or directory
dpkg: error processing man-db (--unpack):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
man-db
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@bishop:~#
The cause was found to be related to a missing "/var/cache/debconf" directory.
rm -fr /var/cache/debconf
apt-get install <some package>
(error)
The module
/usr/share/perl5/Debconf/DbDriver/File.pm
uses 'abs_path' to resolve "/var/cache/debconf" but if the directory
is missing it will return an undefined value resulting in the errors
described. In the module it can be seen that it will create the missing
directory if needed, but this step is performed after the error.
Moving the directory creation to an earlier point resolves the
problem (patch attached).
-- System Information:
Debian Release: jessie/sid
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (500,
'oldstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 3.8-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages debconf depends on:
ii perl-base 5.14.2-21
Versions of packages debconf recommends:
ii apt-utils 0.9.8.1
ii debconf-i18n 1.5.50
Versions of packages debconf suggests:
pn debconf-doc <none>
pn debconf-utils <none>
ii libgtk2-perl 2:1.247-2
pn libnet-ldap-perl <none>
pn libqtcore4-perl <none>
pn libqtgui4-perl <none>
pn libterm-readline-gnu-perl <none>
ii perl 5.14.2-21
ii whiptail 0.52.15-1
-- no debconf information
--- /usr/share/perl5/Debconf/DbDriver/File.pm.orig 2013-05-26 13:00:58.552721414 -0700
+++ /usr/share/perl5/Debconf/DbDriver/File.pm 2013-05-26 13:00:41.492636234 -0700
@@ -39,16 +39,16 @@
$this->error("No filename specified") unless $this->{filename};
+ my ($directory)=$this->{filename}=~m!^(.*)/[^/]+!;
+ if (! -d $directory) {
+ mkdir $directory || $this->error("mkdir $directory:$!");
+ }
+
$this->{filename} = abs_path($this->{filename});
debug "db $this->{name}" => "started; filename is $this->{filename}";
if (! -e $this->{filename}) {
- my ($directory)=$this->{filename}=~m!^(.*)/[^/]+!;
- if (! -d $directory) {
- mkdir $directory || $this->error("mkdir $directory:$!");
- }
-
$this->{backup}=0;
sysopen(my $fh, $this->{filename},
O_WRONLY|O_TRUNC|O_CREAT,$this->{mode}) or