RPM Community Forums

Mailing List Message of <rpm-devel>

Re: rpm-5.1.2 query segfault on certain uninstalled names

From: Jeff Johnson <n3npq@mac.com>
Date: Wed 11 Jun 2008 - 05:57:38 CEST
Message-id: <0B7699B5-7826-4D36-894A-17250FB19F34@mac.com>

On Jun 10, 2008, at 11:29 PM, Jeff Johnson wrote:
>
> The underlying issue is what type of match should be attached
> to RPMMIRE_DEFAULT. I can tell from the constructed "^foo$"
> pattern that a RE is being attempted. However, at some point
> I changed my mind and decided that an RE was overkill when
> only a strcmp(3) is needed. However the odd case of querying
> non-existent uninstalled packages never got found until now.
>
> The other, better, way to fix is what I will likely check-in tomorrow,
> mapping RPMMIRE_DEFAULT onto a strcmp as I intended,
> and changing the code in rpmdb/rpmdb.c to not bother building
> the "^foo$" RE.
>

Actually, I'll likely leave RPMMIRE_DEFAULT as is (in which
case the patch I gave you is the "fix").

There's a still deeper issue that I've always worried about,
likely foolishly.

Most lusers (including me) often confuse globs with regexes.
E.g. I frequently don't bother escaping '.' when using grep,
in most cases it doesn't matter and I 'm both a bad typist
and too lazy to be pedantically correct.

So RPMMIRE_DEFAULT attempts to convert globs into
an anchored simplified RE, escaping periods as needed,
and adding a '.' before a '*' splat.

Whether that decision to convert globs to RE's was wise (or not),
RPMMIRE_DEFAULT is the behavior implemented in rpm for
many years, and so I'll continue with the status quo ante.

Now if I can just get gdb to stop misbehaving, sigh ...

73 de Jeff
Received on Wed Jun 11 05:58:40 2008
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.