- fix segfault on failed url retrieval

- fix verification error code depending on verbosity level
- if anything in testsuite fails, dump out the log
This commit is contained in:
Panu Matilainen 2010-01-21 13:50:59 +00:00
parent 14def245f9
commit bbc081d943
3 changed files with 53 additions and 1 deletions

View File

@ -0,0 +1,19 @@
commit ce1d2e87157f4a7ebc4f4d6f26024ac597400367
Author: Panu Matilainen <pmatilai@redhat.com>
Date: Thu Jan 21 13:45:34 2010 +0200
Fix double-free segfault on url retrieve to read-only media (RhBug:557118)
diff --git a/lib/rpminstall.c b/lib/rpminstall.c
index 6b3dde7..568e13f 100644
--- a/lib/rpminstall.c
+++ b/lib/rpminstall.c
@@ -458,7 +458,7 @@ restart:
case URL_IS_HTTPS:
case URL_IS_HTTP:
case URL_IS_FTP:
- { char *tfn;
+ { char *tfn = NULL;
FD_t tfd;
if (rpmIsVerbose())

View File

@ -0,0 +1,22 @@
commit 04ad4b1155ec4b082fbac425a575a0ba05337ab1
Author: Panu Matilainen <pmatilai@redhat.com>
Date: Thu Jan 21 14:14:28 2010 +0200
Really fix verification error code to not depend on verbosity (RhBug:557101)
- earlier fix from commit 6649c23cac5823d0c7415df5cfd66e5aac5eebd2 was
broken as it could reset return code to zero after detecting errors
earlier
diff --git a/lib/verify.c b/lib/verify.c
index 44ab314..1068cfe 100644
--- a/lib/verify.c
+++ b/lib/verify.c
@@ -353,7 +353,7 @@ static int verifyHeader(QVA_t qva, const rpmts ts, Header h)
static const char *const aok = ".";
static const char *const unknown = "?";
- ec = (verifyResult != 0);
+ if (verifyResult) ec = 1;
#define _verify(_RPMVERIFY_F, _C) \
((verifyResult & _RPMVERIFY_F) ? _C : aok)

View File

@ -21,7 +21,7 @@
Summary: The RPM package management system
Name: rpm
Version: %{rpmver}
Release: 2%{?dist}
Release: 3%{?dist}
Group: System Environment/Base
Url: http://www.rpm.org/
Source0: http://rpm.org/releases/testing/%{name}-%{srcver}.tar.bz2
@ -37,6 +37,8 @@ Patch2: rpm-4.5.90-gstreamer-provides.patch
Patch3: rpm-4.7.90-fedora-specspo.patch
# Patches already in upstream
Patch200: rpm-4.8.0-url-segfault.patch
Patch201: rpm-4.8.0-verify-exitcode.patch
# These are not yet upstream
Patch301: rpm-4.6.0-niagara.patch
@ -181,6 +183,9 @@ packages on a system.
%patch2 -p1 -b .gstreamer-prov
%patch3 -p1 -b .fedora-specspo
%patch200 -p1 -b .url-segfault
%patch201 -p1 -b .verify-exitcode
%patch301 -p1 -b .niagara
%patch302 -p1 -b .geode
@ -267,6 +272,7 @@ rm -rf $RPM_BUILD_ROOT
%if %{with check}
%check
make check
[ "$(ls -A tests/rpmtests.dir)" ] && cat tests/rpmtests.log
%endif
%post libs -p /sbin/ldconfig
@ -394,6 +400,11 @@ exit 0
%doc doc/librpm/html/*
%changelog
* Thu Jan 21 2010 Panu Matilainen <pmatilai@redhat.com> - 4.8.0-3
- fix segfault on failed url retrieval
- fix verification error code depending on verbosity level
- if anything in testsuite fails, dump out the log
* Fri Jan 08 2010 Panu Matilainen <pmatilai@redhat.com> - 4.8.0-2
- put disttag back, accidentally nuked in 4.8.0 final update