Fixes #1410907, #1405570, #1399798, #1410907 etc
This commit is contained in:
Panu Matilainen 2017-02-24 14:43:54 +02:00
parent 7a20d1f47a
commit 074cc434a3
4 changed files with 8 additions and 44 deletions

1
.gitignore vendored
View File

@ -22,3 +22,4 @@
/rpm-4.13.0-rc1.tar.bz2
/rpm-4.13.0-rc2.tar.bz2
/rpm-4.13.0.tar.bz2
/rpm-4.13.0.1.tar.bz2

View File

@ -1,40 +0,0 @@
From f6521c50f6836374a0f7995f8f393aaf36e178ea Mon Sep 17 00:00:00 2001
Message-Id: <f6521c50f6836374a0f7995f8f393aaf36e178ea.1478522529.git.pmatilai@redhat.com>
From: Panu Matilainen <pmatilai@redhat.com>
Date: Mon, 7 Nov 2016 13:38:39 +0200
Subject: [PATCH] Fix %transfiletriggerpostun undeterministic behavior
(RhBug:1284645)
Keys from rpmdbIndexIteratorNext() are not necessarily \0-terminated,
buyer beware.
Sometimes you get lucky, but in particular when built as PIE (such as
by default in Fedora) this falls over consistently.
In Fedora this has been hidden by the fact that test suite has been
disabled because its been so broken with fakechroot until recently,
and without PIE the testsuite regularly passes. Valgrind does
complain though.
---
lib/rpmtriggers.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/lib/rpmtriggers.c b/lib/rpmtriggers.c
index a8612c0..ca22a6b 100644
--- a/lib/rpmtriggers.c
+++ b/lib/rpmtriggers.c
@@ -114,8 +114,11 @@ void rpmtriggersPrepPostUnTransFileTrigs(rpmts ts, rpmte te)
/* Iterate over file triggers in rpmdb */
while ((rpmdbIndexIteratorNext(ii, &key, &keylen)) == 0) {
+ char pfx[keylen + 1];
+ memcpy(pfx, key, keylen);
+ pfx[keylen] = '\0';
/* Check if file trigger matches any file in this te */
- rpmfi fi = rpmfilesFindPrefix(files, key);
+ rpmfi fi = rpmfilesFindPrefix(files, pfx);
if (rpmfiFC(fi) > 0) {
/* If yes then store it */
rpmdbAppendIterator(mi, rpmdbIndexIteratorPkgOffsets(ii),
--
2.7.4

View File

@ -17,7 +17,7 @@
%define rpmhome /usr/lib/rpm
%global rpmver 4.13.0
%global rpmver 4.13.0.1
#global snapver rc2
%global srcver %{version}%{?snapver:-%{snapver}}
%global srcdir %{?snapver:testing}%{!?snapver:%{name}-%(v=%{version}; echo ${v%.*}.x)}
@ -29,7 +29,7 @@
Summary: The RPM package management system
Name: rpm
Version: %{rpmver}
Release: %{?snapver:0.%{snapver}.}7%{?dist}
Release: %{?snapver:0.%{snapver}.}1%{?dist}
Group: System Environment/Base
Url: http://www.rpm.org/
Source0: http://rpm.org/releases/%{srcdir}/%{name}-%{srcver}.tar.bz2
@ -52,7 +52,6 @@ Patch4: rpm-4.8.1-use-gpg2.patch
Patch5: rpm-4.12.0-rpm2cpio-hack.patch
# Patches already upstream:
Patch100: rpm-4.13.x-transfiletriggerpostun-invalid-read.patch
Patch133: rpm-4.13.x-pythondistdeps.patch
Patch134: rpm-4.13.x-pythondistdeps-Makefile.patch
@ -561,6 +560,10 @@ exit 0
%doc doc/librpm/html/*
%changelog
* Fri Feb 24 2017 Panu Matilainen <pmatilai@redhat.com> - 4.13.0.1-1
- Rebase to rpm 4.13.0.1 (http://rpm.org/wiki/Releases/4.13.0.1)
- Fixes #1410907, #1405570, #1399798, #1410907 etc
* Thu Feb 16 2017 Tomas Orsava <torsava@redhat.com> - 4.13.0-7
- Fix handling of Python wheels by pythondistdeps.py --provides (#1421776)

View File

@ -1 +1 @@
f64e70c7548911da51a11651a789e30e rpm-4.13.0.tar.bz2
SHA512 (rpm-4.13.0.1.tar.bz2) = b7475dd0803e06a5dd6a95d0bf8add6ff0d8f0620dd389c4d87a85becb0eb4637aa4ff8c48e18d4844ff6feefa25d642d9f876cd210006cb2144006d34a91b91