!247 backport some patches from upstream
From: @renxichen Reviewed-by: @xujing99 Signed-off-by: @xujing99
This commit is contained in:
commit
d17304cb5f
@ -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
|
||||||
|
|
||||||
9
rpm.spec
9
rpm.spec
@ -1,6 +1,6 @@
|
|||||||
Name: rpm
|
Name: rpm
|
||||||
Version: 4.18.1
|
Version: 4.18.1
|
||||||
Release: 2
|
Release: 3
|
||||||
Summary: RPM Package Manager
|
Summary: RPM Package Manager
|
||||||
License: GPLv2+
|
License: GPLv2+
|
||||||
URL: http://www.rpm.org/
|
URL: http://www.rpm.org/
|
||||||
@ -22,6 +22,10 @@ Patch6000: backport-Fix-compiler-error-on-clang.patch
|
|||||||
Patch6001: backport-Move-variable-to-nearest-available-scope.patch
|
Patch6001: backport-Move-variable-to-nearest-available-scope.patch
|
||||||
Patch6002: backport-revert-Permit-building-rpm-from-git-without-pandoc.patch
|
Patch6002: backport-revert-Permit-building-rpm-from-git-without-pandoc.patch
|
||||||
Patch6003: backport-Fix-per-file-plugin-hook-regression-introduced-in-4..patch
|
Patch6003: backport-Fix-per-file-plugin-hook-regression-introduced-in-4..patch
|
||||||
|
Patch6004: backport-Remove-obscure-check-for-package-build-time-from-reb.patch
|
||||||
|
Patch6005: backport-Fix-possible-null-pointer-reference-in-ndb.patch
|
||||||
|
Patch6006: backport-Fix-rpmDigestBundleFinal-and-Update-return-code-on-i.patch
|
||||||
|
Patch6007: backport-Actually-return-an-error-in-parseScript-if-parsing-f.patch
|
||||||
|
|
||||||
Patch9000: Add-digest-list-plugin.patch
|
Patch9000: Add-digest-list-plugin.patch
|
||||||
Patch9001: Add-IMA-digest-list-support.patch
|
Patch9001: Add-IMA-digest-list-support.patch
|
||||||
@ -304,6 +308,9 @@ make clean
|
|||||||
%exclude %{_mandir}/man8/rpmspec.8.gz
|
%exclude %{_mandir}/man8/rpmspec.8.gz
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Aug 02 2023 renhongxun<renhongxun@h-partners.com> - 4.18.1-3
|
||||||
|
- backport some patches from upstream
|
||||||
|
|
||||||
* Fri Jul 21 2023 xujing<xujing125@huawei.com> - 4.18.1-2
|
* Fri Jul 21 2023 xujing<xujing125@huawei.com> - 4.18.1-2
|
||||||
- fix Unbundle-config-site-and-add-RPM-LD-FLAGS-macro.patch is incorrectly adapted
|
- fix Unbundle-config-site-and-add-RPM-LD-FLAGS-macro.patch is incorrectly adapted
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user