public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Lubos Kardos <lkardos@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/rpm] pmatilai-v6: - Fix not chrooting transaction file triggers
Date: Mon, 23 Nov 2026 09:29:45 GMT	[thread overview]
Message-ID: <179542618570.1.1417420681583318364.rpms-rpm-ece6f423753e@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/rpm
Branch : pmatilai-v6
Commit : ece6f423753ecc4b9c012a2b4186731d8ce3ee07
Author : Lubos Kardos <lkardos@redhat.com>
Date   : 2016-01-15T14:54:25+01:00
Stats  : +76/-1 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/rpm/c/ece6f423753ecc4b9c012a2b4186731d8ce3ee07?branch=pmatilai-v6

Log:
- 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 <lkardos@redhat.com>
+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 <lkardos@redhat.com> - 4.13.0-0.rc1.14
+- Fix not chrooting transaction file triggers
+
 * Mon Nov 23 2015 Lubos Kardos <lkardos@rpm.org> - 4.13.0-0.rc1.13
 - Add possibility to disable file triggers
 - Fix unwanted multiple execution of filetriggers in dnf (#1282115)

                 reply	other threads:[~2026-11-23  9:29 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179542618570.1.1417420681583318364.rpms-rpm-ece6f423753e@fedoraproject.org \
    --to=lkardos@redhat.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox