From ece6f423753ecc4b9c012a2b4186731d8ce3ee07 Mon Sep 17 00:00:00 2001 From: Lubos Kardos Date: Jan 15 2016 13:54:25 +0000 Subject: - Fix not chrooting transaction file triggers --- diff --git a/rpm-4.13.0-chroot-file-triggers.patch b/rpm-4.13.0-chroot-file-triggers.patch new file mode 100644 index 0000000..a5645b6 --- /dev/null +++ b/rpm-4.13.0-chroot-file-triggers.patch @@ -0,0 +1,71 @@ +From 9aff39d0d530332e8cae376f2390b6546239a20e Mon Sep 17 00:00:00 2001 +From: Lubos Kardos +Date: Thu, 14 Jan 2016 13:35:28 +0100 +Subject: [PATCH] Fix not chrooting transaction file triggers + +previously those filetriggers would call tools out of the chroot, which +breaks installers such as DrakX or Anaconda. + +See https://bugs.mageia.org/show_bug.cgi?id=17217 + +Thanks Thierry Vignaud for finding and helping to solve this. +--- + lib/rpmtriggers.c | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +diff --git a/lib/rpmtriggers.c b/lib/rpmtriggers.c +index 211e62f..4c6e821 100644 +--- a/lib/rpmtriggers.c ++++ b/lib/rpmtriggers.c +@@ -11,6 +11,7 @@ + #include "lib/rpmdb_internal.h" + #include "lib/rpmds_internal.h" + #include "lib/rpmfi_internal.h" ++#include "lib/rpmchroot.h" + + #define TRIGGER_PRIORITY_BOUND 10000 + +@@ -157,6 +158,9 @@ int runPostUnTransFileTrigs(rpmts ts) + rpmtriggers trigs = ts->trigs2run; + int nerrors = 0; + ++ if (rpmChrootIn() != 0) ++ return -1; ++ + rpmtriggersSortAndUniq(trigs); + /* Iterate over stored triggers */ + for (i = 0; i < trigs->count; i++) { +@@ -180,6 +184,9 @@ int runPostUnTransFileTrigs(rpmts ts) + rpmScriptFree(script); + headerFree(trigH); + } ++ ++ rpmChrootOut(); ++ + return nerrors; + } + +@@ -530,6 +537,11 @@ rpmRC runFileTriggers(rpmts ts, rpmte te, rpmsenseFlags sense, + /* Sort triggers by priority, offset, trigger index */ + rpmtriggersSortAndUniq(triggers); + ++ if (rpmChrootIn() != 0) { ++ rpmtriggersFree(triggers); ++ return RPMRC_FAIL; ++ } ++ + /* Handle stored triggers */ + for (i = 0; i < triggers->count; i++) { + if (priorityClass == 1) { +@@ -550,6 +562,8 @@ rpmRC runFileTriggers(rpmts ts, rpmte te, rpmsenseFlags sense, + headerFree(trigH); + } + rpmtriggersFree(triggers); ++ /* XXX an error here would require a full abort */ ++ (void) rpmChrootOut(); + + return (nerrors == 0) ? RPMRC_OK : RPMRC_FAIL; + } +-- +1.9.3 + diff --git a/rpm.spec b/rpm.spec index 5553c12..452fe2c 100644 --- a/rpm.spec +++ b/rpm.spec @@ -29,7 +29,7 @@ Summary: The RPM package management system Name: rpm Version: %{rpmver} -Release: %{?snapver:0.%{snapver}.}13%{?dist} +Release: %{?snapver:0.%{snapver}.}14%{?dist} Group: System Environment/Base Url: http://www.rpm.org/ Source0: http://rpm.org/releases/rpm-4.12.x/%{name}-%{srcver}.tar.bz2 @@ -63,6 +63,7 @@ Patch107: rpm-4.13.0-ignore-sigpipe.patch Patch108: rpm-4.13.0-unsupported-keys.patch Patch109: rpm-4.13.0-fix-crash-on-corrupted.patch Patch110: rpm-4.13.0-disabling-filetriggers.patch +Patch111: rpm-4.13.0-chroot-file-triggers.patch # These are not yet upstream Patch302: rpm-4.7.1-geode-i686.patch @@ -567,6 +568,9 @@ exit 0 %doc doc/librpm/html/* %changelog +* Fri Jan 15 2016 Lubos Kardos - 4.13.0-0.rc1.14 +- Fix not chrooting transaction file triggers + * Mon Nov 23 2015 Lubos Kardos - 4.13.0-0.rc1.13 - Add possibility to disable file triggers - Fix unwanted multiple execution of filetriggers in dnf (#1282115)