!246 [sync] PR-241: backport some patches from upstream
From: @openeuler-sync-bot Reviewed-by: @xujing99 Signed-off-by: @xujing99
This commit is contained in:
commit
05cd7f2b9a
@ -0,0 +1,48 @@
|
||||
From 911a4f253c7213a8570028a7dc2a20b045de8e9e Mon Sep 17 00:00:00 2001
|
||||
From: Fabian Vogt <fvogt@suse.de>
|
||||
Date: Mon, 26 Jun 2023 16:28:07 +0200
|
||||
Subject: [PATCH] Actually return an error in parseScript if parsing fails
|
||||
|
||||
The return value is stored in the "res" variable which is set to the return
|
||||
value of parseLines early in the function. Past that point, any "goto exit;"
|
||||
caused the function to return success. This was introduced by 52ce88851abb
|
||||
("Port parseScript() to use parseLines(), no functional changes"). To fix it,
|
||||
reintroduce the nextPart variable.
|
||||
---
|
||||
build/parseScript.c | 6 ++++--
|
||||
1 file changed, 4 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/build/parseScript.c b/build/parseScript.c
|
||||
index f8b693ac6..6f3dc2fe8 100644
|
||||
--- a/build/parseScript.c
|
||||
+++ b/build/parseScript.c
|
||||
@@ -95,7 +95,7 @@ int parseScript(rpmSpec spec, int parsePart)
|
||||
int index;
|
||||
char * reqargs = NULL;
|
||||
|
||||
- int res = PART_ERROR; /* assume failure */
|
||||
+ int nextPart, res = PART_ERROR; /* assume failure */
|
||||
int rc, argc;
|
||||
int arg;
|
||||
const char **argv = NULL;
|
||||
@@ -367,7 +367,7 @@ int parseScript(rpmSpec spec, int parsePart)
|
||||
goto exit;
|
||||
}
|
||||
|
||||
- if ((res = parseLines(spec, STRIP_NOTHING, NULL, &sb)) == PART_ERROR)
|
||||
+ if ((nextPart = parseLines(spec, STRIP_NOTHING, NULL, &sb)) == PART_ERROR)
|
||||
goto exit;
|
||||
|
||||
if (sb) {
|
||||
@@ -479,6 +479,8 @@ int parseScript(rpmSpec spec, int parsePart)
|
||||
}
|
||||
}
|
||||
|
||||
+ res = nextPart;
|
||||
+
|
||||
exit:
|
||||
free(reqargs);
|
||||
freeStringBuf(sb);
|
||||
--
|
||||
2.27.0
|
||||
|
||||
28
backport-Fix-possible-null-pointer-reference-in-ndb.patch
Normal file
28
backport-Fix-possible-null-pointer-reference-in-ndb.patch
Normal file
@ -0,0 +1,28 @@
|
||||
From 8ec9cfc81c3f8326a1c7ee5b795ef517cd48e6b4 Mon Sep 17 00:00:00 2001
|
||||
From: yuxiaojun <yuxiaojun1011@outlook.com>
|
||||
Date: Wed, 14 Jun 2023 11:23:24 +0800
|
||||
Subject: [PATCH] Fix possible null pointer reference in ndb
|
||||
|
||||
slot1 and slot2 may be NULL
|
||||
|
||||
Signed-off-by: yuxiaojun <yuxiaojun1011@outlook.com>
|
||||
---
|
||||
lib/backend/ndb/rpmxdb.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lib/backend/ndb/rpmxdb.c b/lib/backend/ndb/rpmxdb.c
|
||||
index 2c1f29842..d9c373cb0 100644
|
||||
--- a/lib/backend/ndb/rpmxdb.c
|
||||
+++ b/lib/backend/ndb/rpmxdb.c
|
||||
@@ -755,7 +755,7 @@ static int moveblobstofront(rpmxdb xdb, struct xdb_slot *afterslot)
|
||||
if (slot2 == xdb->slots)
|
||||
slot2 = 0;
|
||||
}
|
||||
- if (slot1->pagecnt < slot2->pagecnt) {
|
||||
+ if (slot1 && slot2 && slot1->pagecnt < slot2->pagecnt) {
|
||||
struct xdb_slot *tmp = slot1;
|
||||
slot1 = slot2;
|
||||
slot2 = tmp;
|
||||
--
|
||||
2.27.0
|
||||
|
||||
@ -0,0 +1,40 @@
|
||||
From 3a50688558f18cfb250b2e70bc34464a8e089d32 Mon Sep 17 00:00:00 2001
|
||||
From: Panu Matilainen <pmatilai@redhat.com>
|
||||
Date: Tue, 20 Jun 2023 09:34:47 +0300
|
||||
Subject: [PATCH] Fix rpmDigestBundleFinal() and Update() return code on
|
||||
invalid arguments
|
||||
|
||||
Discovered via #2548, these functions merrily return zero for success
|
||||
when passed NULL data. In rpm nothing bothers to check for their return
|
||||
codes but it doesn't mean it's the right thing to do
|
||||
---
|
||||
rpmio/digest.c | 5 +++--
|
||||
1 file changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/rpmio/digest.c b/rpmio/digest.c
|
||||
index 1975fe6b9..9c679d820 100644
|
||||
--- a/rpmio/digest.c
|
||||
+++ b/rpmio/digest.c
|
||||
@@ -77,8 +77,9 @@ int rpmDigestBundleAddID(rpmDigestBundle bundle, int algo, int id,
|
||||
}
|
||||
int rpmDigestBundleUpdate(rpmDigestBundle bundle, const void *data, size_t len)
|
||||
{
|
||||
- int rc = 0;
|
||||
+ int rc = -1;
|
||||
if (bundle && data && len > 0) {
|
||||
+ rc = 0;
|
||||
for (int i = 0; i <= bundle->index_max; i++) {
|
||||
if (bundle->ids[i] > 0)
|
||||
rc += rpmDigestUpdate(bundle->digests[i], data, len);
|
||||
@@ -91,7 +92,7 @@ int rpmDigestBundleUpdate(rpmDigestBundle bundle, const void *data, size_t len)
|
||||
int rpmDigestBundleFinal(rpmDigestBundle bundle, int id,
|
||||
void ** datap, size_t * lenp, int asAscii)
|
||||
{
|
||||
- int rc = 0;
|
||||
+ int rc = -1;
|
||||
int ix = findID(bundle, id);
|
||||
|
||||
if (ix >= 0) {
|
||||
--
|
||||
2.27.0
|
||||
|
||||
@ -0,0 +1,41 @@
|
||||
From 6caf2a5f586838f6188dd6667a4df6d9c6ec0163 Mon Sep 17 00:00:00 2001
|
||||
From: Panu Matilainen <pmatilai@redhat.com>
|
||||
Date: Thu, 1 Jun 2023 09:45:01 +0300
|
||||
Subject: [PATCH] Remove obscure check for package build time from --rebuilddb
|
||||
(#2527)
|
||||
|
||||
Back in 1997, commit be0b90359bcd8156385178eb9b570c0538c0333f added a
|
||||
sanity check for --rebuilddb operation, skipping headers which lack
|
||||
some basic tags. Name, version and release are real requirements for
|
||||
packages, but checking for buildtime is odd, and plain wrong.
|
||||
Yes, we expect that to be present in packages built by rpm, but that's
|
||||
not used for any processing and certainly is not required for a package
|
||||
to be installable. And if it can be installed then it can't be
|
||||
right to throw it away when rebuilding, leaving untrackable orphan
|
||||
files in the process.
|
||||
|
||||
It is also documented as informational and optional by LSB. While
|
||||
severely outdated, it is right on this account.
|
||||
|
||||
Fixes: #2527
|
||||
---
|
||||
lib/rpmdb.c | 3 +--
|
||||
1 file changed, 1 insertion(+), 2 deletions(-)
|
||||
|
||||
diff --git a/lib/rpmdb.c b/lib/rpmdb.c
|
||||
index b51e9f09e..361f04150 100644
|
||||
--- a/lib/rpmdb.c
|
||||
+++ b/lib/rpmdb.c
|
||||
@@ -2470,8 +2470,7 @@ int rpmdbRebuild(const char * prefix, rpmts ts,
|
||||
/* let's sanity check this record a bit, otherwise just skip it */
|
||||
if (!(headerIsEntry(h, RPMTAG_NAME) &&
|
||||
headerIsEntry(h, RPMTAG_VERSION) &&
|
||||
- headerIsEntry(h, RPMTAG_RELEASE) &&
|
||||
- headerIsEntry(h, RPMTAG_BUILDTIME)))
|
||||
+ headerIsEntry(h, RPMTAG_RELEASE)))
|
||||
{
|
||||
rpmlog(RPMLOG_ERR,
|
||||
_("header #%u in the database is bad -- skipping.\n"),
|
||||
--
|
||||
2.27.0
|
||||
|
||||
10
rpm.spec
10
rpm.spec
@ -1,6 +1,6 @@
|
||||
Name: rpm
|
||||
Version: 4.17.0
|
||||
Release: 26
|
||||
Release: 27
|
||||
Summary: RPM Package Manager
|
||||
License: GPLv2+
|
||||
URL: http://www.rpm.org/
|
||||
@ -108,6 +108,11 @@ Patch6070: backport-Use-proper-type-for-copyTagsFromMainDebug.patch
|
||||
Patch6071: backport-Fix-a-copy-paste-help-description-of-whatconflicts-R.patch
|
||||
Patch6072: backport-Fix-a-segfault-on-a-non-stringable-argument-to-macro.patch
|
||||
|
||||
Patch6073: backport-Remove-obscure-check-for-package-build-time-from-reb.patch
|
||||
Patch6074: backport-Fix-possible-null-pointer-reference-in-ndb.patch
|
||||
Patch6075: backport-Fix-rpmDigestBundleFinal-and-Update-return-code-on-i.patch
|
||||
Patch6076: backport-Actually-return-an-error-in-parseScript-if-parsing-f.patch
|
||||
|
||||
BuildRequires: gcc autoconf automake libtool make gawk popt-devel openssl-devel readline-devel
|
||||
BuildRequires: zlib-devel zstd-devel >= 1.3.8 xz-devel bzip2-devel libarchive-devel ima-evm-utils-devel
|
||||
BuildRequires: dbus-devel fakechroot elfutils-devel elfutils-libelf-devel ima-evm-utils
|
||||
@ -381,6 +386,9 @@ make check || (cat tests/rpmtests.log; exit 0)
|
||||
%{_mandir}/man1/gendiff.1*
|
||||
|
||||
%changelog
|
||||
* Wed Aug 02 2023 renhongxun<renhongxun@h-partners.com> - 4.17.0-27
|
||||
- backport some patches from upstream
|
||||
|
||||
* Fri Jun 16 2023 renhongxun<renhongxun@h-partners.com> - 4.17.0-26
|
||||
- Fix a segfault on a non-stringable argument to macro call from Lua
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user