!291 rpm: update version to 4.18.2

From: @xujing99 
Reviewed-by: @licunlong 
Signed-off-by: @licunlong
This commit is contained in:
openeuler-ci-bot 2024-01-30 03:00:57 +00:00 committed by Gitee
commit 8c3873334b
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
13 changed files with 8 additions and 363 deletions

View File

@ -187,7 +187,7 @@ index eb008ab..3fc3551 100644
{ {
FileListRec flp; FileListRec flp;
@@ -1003,6 +1144,11 @@ static void genCpioListAndHeader(FileList fl, Package pkg, int isSrc) @@ -1003,6 +1144,11 @@ static void genCpioListAndHeader(FileList fl, Package pkg, int isSrc)
Header h = pkg->header; /* just a shortcut */ int override_date = 0;
time_t source_date_epoch = 0; time_t source_date_epoch = 0;
char *srcdate = getenv("SOURCE_DATE_EPOCH"); char *srcdate = getenv("SOURCE_DATE_EPOCH");
+ struct rpmtd_s oldfiledigests; + struct rpmtd_s oldfiledigests;

View File

@ -1,48 +0,0 @@
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

View File

@ -1,26 +0,0 @@
From 03525592c944957f3b7b200b7daeb9f615cdcde7 Mon Sep 17 00:00:00 2001
From: Panu Matilainen <pmatilai@redhat.com>
Date: Tue, 23 May 2023 12:46:22 +0300
Subject: [PATCH] Fix a copy-paste --help description of --whatconflicts
(RhBug:2208661)
---
lib/poptQV.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/poptQV.c b/lib/poptQV.c
index ac8e8975d..8bd91c652 100644
--- a/lib/poptQV.c
+++ b/lib/poptQV.c
@@ -108,7 +108,7 @@ struct poptOption rpmQVSourcePoptTable[] = {
{ "verify", 'V', POPT_ARGFLAG_DOC_HIDDEN, NULL, 'V',
N_("rpm verify mode"), NULL },
{ "whatconflicts", '\0', 0, 0, POPT_WHATCONFLICTS,
- N_("query/verify the package(s) which require a dependency"), "CAPABILITY" },
+ N_("query/verify the package(s) which conflict with a dependency"), "CAPABILITY" },
{ "whatrequires", '\0', 0, 0, POPT_WHATREQUIRES,
N_("query/verify the package(s) which require a dependency"), "CAPABILITY" },
{ "whatobsoletes", '\0', 0, 0, POPT_WHATOBSOLETES,
--
2.27.0

View File

@ -1,58 +0,0 @@
From 856ddc334174fd37fe4ce81bc9f9f11a08cf6c81 Mon Sep 17 00:00:00 2001
From: Panu Matilainen <pmatilai@redhat.com>
Date: Fri, 17 Mar 2023 12:53:42 +0200
Subject: [PATCH] Fix a segfault on a non-stringable argument to macro call
from Lua
When natively calling a parametric macro from Lua, with the arguments
inside a table, we can't assume lua_tostring() always succeeds as it
can fail eg on a table. Report the error instead of crashing in argvAdd(),
and add a test as well.
---
rpmio/rpmlua.c | 9 +++++++--
tests/rpmmacro.at | 9 +++++++++
2 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/rpmio/rpmlua.c b/rpmio/rpmlua.c
index 6c42af792..0e3685713 100644
--- a/rpmio/rpmlua.c
+++ b/rpmio/rpmlua.c
@@ -1178,8 +1178,13 @@ static int mc_call(lua_State *L)
for (int i = 1; i <= nitem; i++) {
lua_rawgeti(L, 1, i);
- argvAdd(&argv, lua_tostring(L, -1));
- lua_pop(L, 1);
+ const char *s= lua_tostring(L, -1);
+ if (s) {
+ argvAdd(&argv, s);
+ lua_pop(L, 1);
+ } else {
+ luaL_argerror(L, i, "cannot convert to string");
+ }
}
if (rpmExpandThisMacro(*mc, name, argv, &buf, 0) >= 0) {
diff --git a/tests/rpmmacro.at b/tests/rpmmacro.at
index 55b7d5fa5..22d873e81 100644
--- a/tests/rpmmacro.at
+++ b/tests/rpmmacro.at
@@ -713,6 +713,15 @@ nil
1:%{?aaa} 2:%{yyy}
that
])
+
+AT_CHECK([[
+runroot rpm \
+ --eval "%{lua:macros.defined({1,2,{}})}"
+]],
+[1],
+[],
+[[error: lua script failed: [string "<lua>"]:1: bad argument #3 to 'defined' (cannot convert to string)
+]])
AT_CLEANUP
AT_SETUP([lua macros recursion])
--
2.33.0

View File

@ -1,40 +0,0 @@
From b960c0b43a080287a7c13533eeb2d9f288db1414 Mon Sep 17 00:00:00 2001
From: Florian Festi <ffesti@redhat.com>
Date: Thu, 16 Mar 2023 19:05:04 +0100
Subject: [PATCH] Fix compiler error on clang
Turns out variable declarations are not allowed after a label, even in
C99. And while some compilers don't seem to care others do.
Moving the declaration of mayopen to the start of the function to avoid
this problem.
Resolves: #2435
---
lib/fsm.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/fsm.c b/lib/fsm.c
index 5671ac642..183293edb 100644
--- a/lib/fsm.c
+++ b/lib/fsm.c
@@ -879,6 +879,7 @@ int rpmPackageFilesInstall(rpmts ts, rpmte te, rpmfiles files,
int nodigest = (rpmtsFlags(ts) & RPMTRANS_FLAG_NOFILEDIGEST) ? 1 : 0;
int nofcaps = (rpmtsFlags(ts) & RPMTRANS_FLAG_NOCAPS) ? 1 : 0;
int firstlinkfile = -1;
+ int mayopen = 0;
char *tid = NULL;
struct filedata_s *fdata = xcalloc(fc, sizeof(*fdata));
struct filedata_s *firstlink = NULL;
@@ -1016,7 +1017,7 @@ int rpmPackageFilesInstall(rpmts ts, rpmte te, rpmfiles files,
setmeta:
/* Special files require path-based ops */
- int mayopen = S_ISREG(fp->sb.st_mode) || S_ISDIR(fp->sb.st_mode);
+ mayopen = S_ISREG(fp->sb.st_mode) || S_ISDIR(fp->sb.st_mode);
if (!rc && fd == -1 && mayopen) {
int flags = O_RDONLY;
/* Only follow safe symlinks, and never on temporary files */
--
2.33.0

View File

@ -1,32 +0,0 @@
From 7072b2d2b92e4d2731451bdcca8d83ab6b945016 Mon Sep 17 00:00:00 2001
From: Panu Matilainen <pmatilai@redhat.com>
Date: Tue, 20 Jun 2023 10:11:20 +0300
Subject: [PATCH] Fix per-file plugin hook regression introduced in 4.18
Commit 6dd62720fe84f7e2ad902c915b952fc0b29e3dcd neglected to update
rpmpluginsCallFsmFilePost() to pass the absolute path in the case
of unowned directories. Because in that case there's no rpmfi to
pass to the plugin in that case, there's simply no way for the plugin
to know what path is being manipulated. Oops.
Fixes: #2543
---
lib/fsm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/fsm.c b/lib/fsm.c
index 747ed2b09..c44f6313c 100644
--- a/lib/fsm.c
+++ b/lib/fsm.c
@@ -360,7 +360,7 @@ static int fsmDoMkDir(rpmPlugins plugins, int dirfd, const char *dn,
}
/* Run fsm file post hook for all plugins */
- rpmpluginsCallFsmFilePost(plugins, NULL, dn, mode, op, rc);
+ rpmpluginsCallFsmFilePost(plugins, NULL, apath, mode, op, rc);
if (!rc) {
rpmlog(RPMLOG_DEBUG,
--
2.27.0

View File

@ -1,28 +0,0 @@
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

View File

@ -1,40 +0,0 @@
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

View File

@ -1,36 +0,0 @@
From 8be31c77806604cdca3cf628fb087bc1cc3d5c9e Mon Sep 17 00:00:00 2001
From: Panu Matilainen <pmatilai@redhat.com>
Date: Fri, 17 Mar 2023 14:36:26 +0200
Subject: [PATCH] Move variable to nearest available scope
Commit b960c0b43a080287a7c13533eeb2d9f288db1414 moved mayopen all the
way to the function scope when the local if scope would've been enough.
In a function with complex loops and all, nothing good comes out of having
variables at unnecessarily wide scope.
---
lib/fsm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/fsm.c b/lib/fsm.c
index 183293edb..747ed2b09 100644
--- a/lib/fsm.c
+++ b/lib/fsm.c
@@ -879,7 +879,6 @@ int rpmPackageFilesInstall(rpmts ts, rpmte te, rpmfiles files,
int nodigest = (rpmtsFlags(ts) & RPMTRANS_FLAG_NOFILEDIGEST) ? 1 : 0;
int nofcaps = (rpmtsFlags(ts) & RPMTRANS_FLAG_NOCAPS) ? 1 : 0;
int firstlinkfile = -1;
- int mayopen = 0;
char *tid = NULL;
struct filedata_s *fdata = xcalloc(fc, sizeof(*fdata));
struct filedata_s *firstlink = NULL;
@@ -940,6 +939,7 @@ int rpmPackageFilesInstall(rpmts ts, rpmte te, rpmfiles files,
fp = firstlink;
if (!fp->skip) {
+ int mayopen = 0;
int fd = -1;
rc = ensureDir(plugins, rpmfiDN(fi), 0,
(fp->action == FA_CREATE), 0, &di.dirfd);
--
2.33.0

View File

@ -1,41 +0,0 @@
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

Binary file not shown.

BIN
rpm-4.18.2.tar.bz2 Normal file

Binary file not shown.

View File

@ -1,6 +1,6 @@
Name: rpm Name: rpm
Version: 4.18.1 Version: 4.18.2
Release: 9 Release: 1
Summary: RPM Package Manager Summary: RPM Package Manager
License: GPLv2+ License: GPLv2+
URL: http://www.rpm.org/ URL: http://www.rpm.org/
@ -18,17 +18,8 @@ Patch9: Add-loongarch-architecture-support.patch
Patch10: rpm-Add-sw64-architecture.patch Patch10: rpm-Add-sw64-architecture.patch
Patch11: add-default-machine-name-to-support-loongarch.patch Patch11: add-default-machine-name-to-support-loongarch.patch
Patch6000: backport-Fix-compiler-error-on-clang.patch Patch6000: backport-revert-Permit-building-rpm-from-git-without-pandoc.patch
Patch6001: backport-Move-variable-to-nearest-available-scope.patch Patch6001: backport-Check-inside-root-when-querying-for-files.patch
Patch6002: backport-revert-Permit-building-rpm-from-git-without-pandoc.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
Patch6008: backport-Check-inside-root-when-querying-for-files.patch
Patch6009: backport-Fix-a-segfault-on-a-non-stringable-argument-to-macro.patch
Patch6010: backport-Fix-a-copy-paste-help-description-of-whatconflicts-R.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
@ -327,6 +318,9 @@ make clean
%exclude %{_mandir}/man8/rpmspec.8.gz %exclude %{_mandir}/man8/rpmspec.8.gz
%changelog %changelog
* Sat Jan 27 2024 xujing<xujing125@huawei.com> - 4.18.2-1
- update version to 4.18.2 (https://rpm.org/wiki/Releases/4.18.2)
* Tue Sep 26 2023 renhongxun<renhongxun@h-partners.com> - 4.18.1-9 * Tue Sep 26 2023 renhongxun<renhongxun@h-partners.com> - 4.18.1-9
- Fix potential segmentation fault - Fix potential segmentation fault