Package: debianutils
Version: 4.5.1
Severity: normal
Tags: patch

Dear Maintainer,

When using the --lsbsysinit, run-parts skips files like dpkg-old that
are cruft from dpkg's conffile conflict handling. However, the way
the exclude pattern is defined and contrary to documentation, also
files without a dot before "dpkg-" are skipped.

How to repeat:

cd $(mktemp -d)
touch cloud.dpkg-dist
chmod 755 cloud.dpkg-dist
cp cloud.dpkg-dist cloud.dpkg-file
cp cloud.dpkg-dist cloudpkg-dist
run-parts --lsbsysinit --test .

Expected result:

./cloudpkg-dist
./cloud.dpkg-file

Actual result:

./cloud.dpkg-file


Now "cloudpkg-dist" might be a bit usual but it certainly might
happen. The patch is trivial, see below.

    Christoph

-- System Information:
Debian Release: stretch/sid
  APT prefers testing-updates
  APT policy: (500, 'testing-updates'), (500, 'testing')
Architecture: amd64 (x86_64)


--- a/run-parts.c
+++ b/run-parts.c
@@ -579,7 +579,7 @@ regex_compile_pattern (void)
                     REG_EXTENDED | REG_NOSUB)) != 0)
             pt_regex = &hierre;
 
-        else if ( (err = regcomp(&excsre, 
"^[a-z0-9-].*dpkg-(old|dist|new|tmp)$",
+        else if ( (err = regcomp(&excsre, 
"^[a-z0-9-].*\\.dpkg-(old|dist|new|tmp)$",
                     REG_EXTENDED | REG_NOSUB)) != 0)
             pt_regex = &excsre;
 

Attachment: signature.asc
Description: Digital signature

Reply via email to