Bug#998335: debsums: fails to handle files with spaces

Tom bug at users.ch.eu.org
Tue Nov 2 17:34:36 GMT 2021


Hi Axel

> Thanks for the example. But from where is that package? Doesn't seem
> to be an official Debian package. Am I right, that the package is
> from
> https://apt.homegear.eu/

That's right. I have the following repo in my sources.list.d/:
deb https://apt.homegear.eu/Debian/ bullseye/

If the package itsself is responsible for the entries in
/var/lib/dpkg/status and if there is a way to escape a space, then the
bug should be filed against the package.

> > --- /usr/bin/debsums.orig	2021-11-02 15:34:32.689829644 +0100
> > +++ /usr/bin/debsums	2021-11-02 16:49:18.669901591 +0100
> > @@ -264,7 +264,7 @@
> >              $package_name{$field{"Package"}} =
> > $field{"binary:Package"};
> >          }
> >          $installed{$field{"binary:Package"}}{Conffiles} = {
> > -            map m!^\s*/(\S+)\s+([\da-f]+)!,
> > +            map m!^\s*/(.+)\s+([\da-f]+)!,
> >                  grep { not ($ignore_obsolete and / obsolete$/) }
> >                  split /\n/, $field{Conffiles}
> >          } if $field{Conffiles};
> 
> Not sure from a first glance either. This \S looks as if was there on
> purpose. Will need a closer look.

I'm not sure either. But if this regex is greedy, it will stop at the
first space. My version stops before the last space before the md5sum.
That being said, my version will also fail (as will the current version
of debsums) if:
- the name contains spaces and
- the last portion after a space contains digits and a-f
- there is no md5sum (which probably should not happen)

Cheers
Tom



More information about the pkg-perl-maintainers mailing list