Red Hat Bugzilla – Bug 277161
Fault when querying against DSAHEADER
Last modified: 2007-11-30 17:12:14 EST
The following query results in a fault in rpm-184.108.40.206-1.fc7.i386:
rpm -qa "dsaheader=*30c9ecf8*"
Fault and trace attached.
Created attachment 186491 [details]
Created attachment 186501 [details]
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)
Fixed in rpm.org HEAD, needs backporting to 220.127.116.11...
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) <firstname.lastname@example.org>)
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.
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)
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.
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.
Since sourcepkgid is not currently included in Fedora packages, pattern matching against
a non-existent tag is likely of academic interest only as well.
Fixed in next rawhide push by rpm 18.104.22.168-rc2
rpm-22.214.171.124-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'
rpm-126.96.36.199-2.fc7 has been pushed to the Fedora 7 stable repository. If problems still persist, please make note of it in this bug report.