[Pkg-sysvinit-devel] Bug#431224: update-rc.d: package names with + or * not installable

Steffen Moeller steffen_moeller at gmx.de
Sat Jun 30 20:09:23 UTC 2007


Package: sysv-rc
Version: 2.86.ds1-38
Severity: important
Tags: patch

dpkg calls update-rc.d to execute the post-inst script. In line 110, the
name of the package becomes part of a regular expression. The occurrence
of + or other characters with a special meaning that may be part of the
package name lets the script bail out:

Nested quantifiers in regex; marked by <-- HERE in m/^[SK]\d\dfact++ <--
HERE $/ at /usr/sbin/update-rc.d line 110.

The patch below takes extra precaution to escape the most likely
candidates: * and +.

Best regards

Steffen

--- /usr/sbin/update-rc.d.orig  2007-06-30 21:50:48.430227606 +0200
+++ /usr/sbin/update-rc.d       2007-06-30 21:54:12.973512144 +0200
@@ -103,8 +103,11 @@
            die("update-rc.d: chdir $etcd$i.d: $!\n");
        }
        opendir(DIR, ".");
+       my $saveBN=$bn;
+       $saveBN =~ s/\+/\\+/g;
+       $saveBN =~ s/\*/\\*/g;
        foreach $_ (readdir(DIR)) {
-           next unless (/^[SK]\d\d$bn$/);
+           next unless (/^[SK]\d\d$saveBN$/);
            $fn = "$etcd$i.d/$_";
            $found = 1;
            $islnk = &is_link ($_[0], $fn, $bn);


-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.20-1-686 (SMP w/1 CPU core)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

sysv-rc depends on no packages.

Versions of packages sysv-rc recommends:
ii  lsb-base                      3.1-23.1   Linux Standard Base 3.1 init scrip

-- no debconf information




More information about the Pkg-sysvinit-devel mailing list