diff --git a/Add-IMA-digest-list-support.patch b/Add-IMA-digest-list-support.patch index e0573c4..223c645 100644 --- a/Add-IMA-digest-list-support.patch +++ b/Add-IMA-digest-list-support.patch @@ -187,7 +187,7 @@ index eb008ab..3fc3551 100644 { FileListRec flp; @@ -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; char *srcdate = getenv("SOURCE_DATE_EPOCH"); + struct rpmtd_s oldfiledigests; diff --git a/backport-Actually-return-an-error-in-parseScript-if-parsing-f.patch b/backport-Actually-return-an-error-in-parseScript-if-parsing-f.patch deleted file mode 100644 index e6732d0..0000000 --- a/backport-Actually-return-an-error-in-parseScript-if-parsing-f.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 911a4f253c7213a8570028a7dc2a20b045de8e9e Mon Sep 17 00:00:00 2001 -From: Fabian Vogt -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 - diff --git a/backport-Fix-a-copy-paste-help-description-of-whatconflicts-R.patch b/backport-Fix-a-copy-paste-help-description-of-whatconflicts-R.patch deleted file mode 100644 index ad4d1e7..0000000 --- a/backport-Fix-a-copy-paste-help-description-of-whatconflicts-R.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 03525592c944957f3b7b200b7daeb9f615cdcde7 Mon Sep 17 00:00:00 2001 -From: Panu Matilainen -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 - diff --git a/backport-Fix-a-segfault-on-a-non-stringable-argument-to-macro.patch b/backport-Fix-a-segfault-on-a-non-stringable-argument-to-macro.patch deleted file mode 100644 index c612611..0000000 --- a/backport-Fix-a-segfault-on-a-non-stringable-argument-to-macro.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 856ddc334174fd37fe4ce81bc9f9f11a08cf6c81 Mon Sep 17 00:00:00 2001 -From: Panu Matilainen -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 ""]:1: bad argument #3 to 'defined' (cannot convert to string) -+]]) - AT_CLEANUP - - AT_SETUP([lua macros recursion]) --- -2.33.0 - diff --git a/backport-Fix-compiler-error-on-clang.patch b/backport-Fix-compiler-error-on-clang.patch deleted file mode 100644 index ec0a88d..0000000 --- a/backport-Fix-compiler-error-on-clang.patch +++ /dev/null @@ -1,40 +0,0 @@ -From b960c0b43a080287a7c13533eeb2d9f288db1414 Mon Sep 17 00:00:00 2001 -From: Florian Festi -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 - diff --git a/backport-Fix-per-file-plugin-hook-regression-introduced-in-4..patch b/backport-Fix-per-file-plugin-hook-regression-introduced-in-4..patch deleted file mode 100644 index 2cb653c..0000000 --- a/backport-Fix-per-file-plugin-hook-regression-introduced-in-4..patch +++ /dev/null @@ -1,32 +0,0 @@ -From 7072b2d2b92e4d2731451bdcca8d83ab6b945016 Mon Sep 17 00:00:00 2001 -From: Panu Matilainen -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 - diff --git a/backport-Fix-possible-null-pointer-reference-in-ndb.patch b/backport-Fix-possible-null-pointer-reference-in-ndb.patch deleted file mode 100644 index b2aeb03..0000000 --- a/backport-Fix-possible-null-pointer-reference-in-ndb.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 8ec9cfc81c3f8326a1c7ee5b795ef517cd48e6b4 Mon Sep 17 00:00:00 2001 -From: yuxiaojun -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 ---- - 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 - diff --git a/backport-Fix-rpmDigestBundleFinal-and-Update-return-code-on-i.patch b/backport-Fix-rpmDigestBundleFinal-and-Update-return-code-on-i.patch deleted file mode 100644 index b1dd56d..0000000 --- a/backport-Fix-rpmDigestBundleFinal-and-Update-return-code-on-i.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 3a50688558f18cfb250b2e70bc34464a8e089d32 Mon Sep 17 00:00:00 2001 -From: Panu Matilainen -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 - diff --git a/backport-Move-variable-to-nearest-available-scope.patch b/backport-Move-variable-to-nearest-available-scope.patch deleted file mode 100644 index 072296d..0000000 --- a/backport-Move-variable-to-nearest-available-scope.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 8be31c77806604cdca3cf628fb087bc1cc3d5c9e Mon Sep 17 00:00:00 2001 -From: Panu Matilainen -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 - diff --git a/backport-Remove-obscure-check-for-package-build-time-from-reb.patch b/backport-Remove-obscure-check-for-package-build-time-from-reb.patch deleted file mode 100644 index 2bd4c62..0000000 --- a/backport-Remove-obscure-check-for-package-build-time-from-reb.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 6caf2a5f586838f6188dd6667a4df6d9c6ec0163 Mon Sep 17 00:00:00 2001 -From: Panu Matilainen -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 - diff --git a/rpm-4.18.1.tar.bz2 b/rpm-4.18.1.tar.bz2 deleted file mode 100644 index 812b8c4..0000000 Binary files a/rpm-4.18.1.tar.bz2 and /dev/null differ diff --git a/rpm-4.18.2.tar.bz2 b/rpm-4.18.2.tar.bz2 new file mode 100644 index 0000000..7f97494 Binary files /dev/null and b/rpm-4.18.2.tar.bz2 differ diff --git a/rpm.spec b/rpm.spec index a759989..a21d8fb 100644 --- a/rpm.spec +++ b/rpm.spec @@ -1,6 +1,6 @@ Name: rpm -Version: 4.18.1 -Release: 9 +Version: 4.18.2 +Release: 1 Summary: RPM Package Manager License: GPLv2+ URL: http://www.rpm.org/ @@ -18,17 +18,8 @@ Patch9: Add-loongarch-architecture-support.patch Patch10: rpm-Add-sw64-architecture.patch Patch11: add-default-machine-name-to-support-loongarch.patch -Patch6000: backport-Fix-compiler-error-on-clang.patch -Patch6001: backport-Move-variable-to-nearest-available-scope.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 +Patch6000: backport-revert-Permit-building-rpm-from-git-without-pandoc.patch +Patch6001: backport-Check-inside-root-when-querying-for-files.patch Patch9000: Add-digest-list-plugin.patch Patch9001: Add-IMA-digest-list-support.patch @@ -327,6 +318,9 @@ make clean %exclude %{_mandir}/man8/rpmspec.8.gz %changelog +* Sat Jan 27 2024 xujing - 4.18.2-1 +- update version to 4.18.2 (https://rpm.org/wiki/Releases/4.18.2) + * Tue Sep 26 2023 renhongxun - 4.18.1-9 - Fix potential segmentation fault