Bug 277161 - Fault when querying against DSAHEADER
Fault when querying against DSAHEADER
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: rpm (Show other bugs)
rawhide
i386 Linux
medium Severity low
: ---
: ---
Assigned To: Panu Matilainen
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-09-04 15:31 EDT by Ignacio Vazquez-Abrams
Modified: 2007-11-30 17:12 EST (History)
2 users (show)

See Also:
Fixed In Version: 4.4.2.2-2.fc7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-10-24 03:14:08 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
rpmq fault (4.71 KB, text/plain)
2007-09-04 15:31 EDT, Ignacio Vazquez-Abrams
no flags Details
rpmq trace (4.40 KB, text/plain)
2007-09-04 15:32 EDT, Ignacio Vazquez-Abrams
no flags Details

  None (edit)
Description Ignacio Vazquez-Abrams 2007-09-04 15:31:35 EDT
The following query results in a fault in rpm-4.4.2.1-1.fc7.i386:

rpm -qa "dsaheader=*30c9ecf8*"

Fault and trace attached.
Comment 1 Ignacio Vazquez-Abrams 2007-09-04 15:31:35 EDT
Created attachment 186491 [details]
rpmq fault
Comment 2 Ignacio Vazquez-Abrams 2007-09-04 15:32:15 EDT
Created attachment 186501 [details]
rpmq trace
Comment 3 Panu Matilainen 2007-09-05 03:10:50 EDT
Easily reproduced. There are actually a number of bugs here, urgh...
- matching against "binary blob" type (such as dsaheader) isn't handled at all
- attempting matching against binary blobs segfaults
- matching produces false results if the header to be matched against isn't
present in package(s)
Comment 4 Panu Matilainen 2007-09-05 06:47:47 EDT
Fixed in rpm.org HEAD, needs backporting to 4.4.2.2...
Comment 5 Jeff Johnson 2007-09-06 02:50:30 EDT
Sure there are any number of bugs retrieving a header tag by regex retrieval applied against
binary data, now converted to text. I will likely steal the patch soon, but implement rather differently.
headerGetExtension is ther to to coerce data types onto tags.

However, the functionality of the access itself makes no sense. Loading every header to retrieve
RPMTAG_DSAHEADER which is converted to hex so that a pattern can be applied to find which
packages were signed with the pubkey
    gpg(Fedora Project (Test Software) <rawhide@redhat.com>)
should be done with a --queryformat, not a regex. You won't be happy with the
false positives from the pattern match even if you are willing to live with the performance
cost of loading every installed header.

I.e. blocking regexes appled to binary data, rather than drilling the hex convert through
mireFoo() is likely more useful.  And if there is a need for retrieving packages signed with
a specific pubkey fingerprint, then an index (for highest performance), or a popt alias
to hide a complex --queryformat to be post filtered with --pipe needs doing.
Comment 6 Panu Matilainen 2007-09-06 03:26:34 EDT
Yup, retrieving by signing key is somewhat different issue and wants
queryformat, not hex dumps. Converting binary to hex and matching is mostly of
academical interest, there's probably just one case where it might actually be
useful (sourcepkgid to be exact)
Comment 7 Ignacio Vazquez-Abrams 2007-09-06 06:13:23 EDT
In that case go ahead and close the report if the fault is fixed. I'll worry
about the actual querying part some other way.
Comment 8 Jeff Johnson 2007-09-06 08:09:51 EDT
If Sourcepkgid: is the issue, its value in packages should be changed to a string.

Querying by pkgid is already drilled with an index for performance. Querying by
sourcepkgid is no harder than changing a tag.
Comment 9 Jeff Johnson 2007-09-06 08:36:29 EDT
Since sourcepkgid is not currently included in Fedora packages, pattern matching against
a non-existent tag is likely of academic interest only as well.
Comment 10 Panu Matilainen 2007-09-11 03:29:03 EDT
Fixed in next rawhide push by rpm 4.4.2.2-rc2
Comment 11 Fedora Update System 2007-10-12 16:02:36 EDT
rpm-4.4.2.2-2.fc7 has been pushed to the Fedora 7 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update rpm'
Comment 12 Fedora Update System 2007-10-24 03:13:56 EDT
rpm-4.4.2.2-2.fc7 has been pushed to the Fedora 7 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.