Log In
Log In
Places
All Projects
Status Monitor
Collapse sidebar
obs:server:fedora:2.8
libsolv
libsolv-fix-pkgid.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File libsolv-fix-pkgid.patch of Package libsolv
From 44789de119eaa6fea7fa77bdc31dd857d06e1444 Mon Sep 17 00:00:00 2001 From: Oleg Girko <ol@infoserver.lv> Date: Wed, 14 Feb 2018 01:41:38 +0000 Subject: [PATCH] Fix pkgid extraction when adding rpm file to repo if built with librpm. MD5 checksum is extracted from first header of rpm file and used as pkgid if repo_add_rpm() function is called with RPM_ADD_WITH_PKGID flag. If libsolv is built with ENABLE_RPMPKG_LIBRPM option, rpm file header is read using librpm's headerImport() function with HEADERIMPORT_FAST flag. This flag causes librpm to use simplified algorithm to find actual data size in index entry. This algorithm just uses difference between offsets in consecutive index entries, assuming that there are no gaps between entries in header data. Unfortunately, in some cases there are gaps, so returned data length for MD5 checksum may be slightly greater than 16 bytes. This causes check for checksum size to be equal to 16 to fail, resulting in pkgid not being added. This change relaxes check for returned MD5 checksum size, allowing it to be greater that 16. Alternatively, this problem can be fixed by not using HEADERIMPORT_FAST, but it will slow down package import. Example of rpm package causing this problem: https://dl.fedoraproject.org/pub/fedora/linux/releases/27/Everything/x86_64/os/Packages/p/perl-Text-Balanced-2.03-394.fc27.noarch.rpm Signed-off-by: Oleg Girko <ol@infoserver.lv> --- ext/repo_rpmdb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/repo_rpmdb.c b/ext/repo_rpmdb.c index ee226e70..5a967ad2 100644 --- a/ext/repo_rpmdb.c +++ b/ext/repo_rpmdb.c @@ -2005,7 +2005,7 @@ repo_add_rpm(Repo *repo, const char *rpm, int flags) unsigned char *chksum; unsigned int chksumsize; chksum = headbinary(state.rpmhead, SIGTAG_MD5, &chksumsize); - if (chksum && chksumsize == 16) + if (chksum && chksumsize >= 16) { pkgidtype = REPOKEY_TYPE_MD5; memcpy(pkgid, chksum, 16); -- 2.14.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Contact
Support
@OBShq
The Open Build Service is an
openSUSE project
.
Log In
Places
Places
All Projects
Status Monitor