From 1ce10ab6e7e15c15699ee830d61542355f1dc9ee Mon Sep 17 00:00:00 2001 From: renxichen Date: Wed, 21 Jun 2023 11:03:58 +0800 Subject: [PATCH] Fix per-file plugin hook regression introduced in 4.18 --- ...gin-hook-regression-introduced-in-4..patch | 32 +++++++++++++++++++ rpm.spec | 6 +++- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 backport-Fix-per-file-plugin-hook-regression-introduced-in-4..patch 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 new file mode 100644 index 0000000..2cb653c --- /dev/null +++ b/backport-Fix-per-file-plugin-hook-regression-introduced-in-4..patch @@ -0,0 +1,32 @@ +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/rpm.spec b/rpm.spec index 60ef941..fcfe353 100644 --- a/rpm.spec +++ b/rpm.spec @@ -1,6 +1,6 @@ Name: rpm Version: 4.18.0 -Release: 10 +Release: 11 Summary: RPM Package Manager License: GPLv2+ URL: http://www.rpm.org/ @@ -40,6 +40,7 @@ Patch6017: backport-support-for-POSIX-getopt-behaviour.patch Patch6018: backport-Use-proper-type-for-copyTagsFromMainDebug.patch Patch6019: backport-Fix-a-copy-paste-help-description-of-whatconflicts-R.patch Patch6020: backport-Fix-a-segfault-on-a-non-stringable-argument-to-macro.patch +Patch6021: backport-Fix-per-file-plugin-hook-regression-introduced-in-4..patch Patch9000: Add-digest-list-plugin.patch Patch9001: Add-IMA-digest-list-support.patch @@ -329,6 +330,9 @@ make clean %exclude %{_mandir}/man8/rpmspec.8.gz %changelog +* Wed Jun 21 2023 renhongxun - 4.18.0-11 +- Fix per-file plugin hook regression introduced in 4.18 + * Mon Jun 19 2023 renhongxun - 4.18.0-10 - Fix a segfault on a non-stringable argument to macro call from Lua