[Reproducible-commits] [dpkg] 12/25: libdpkg: Fix file triggers/Unincorp descriptor leak on subprocesses

Holger Levsen holger at layer-acht.org
Tue May 3 08:43:54 UTC 2016


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to annotated tag 1.16.16
in repository dpkg.

commit 76c2e44f53dcaf73727ffc76c20b934c0a8541bc
Author: Guillem Jover <guillem at debian.org>
Date:   Mon Jun 9 19:38:05 2014 +0200

    libdpkg: Fix file triggers/Unincorp descriptor leak on subprocesses
    
    Cherry picked from commit 92ab1bb69c3f251a2811015d94d1933b3b39e43a.
    
    Regression introduced in commit 10440009b68f59eeed4cb1b56547e3cf356aa540,
    with the initial triggers implementation.
    
    Closes: #751021
---
 debian/changelog        | 3 +++
 lib/dpkg/trigdeferred.l | 4 ++++
 2 files changed, 7 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 211fff4..3416d43 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -9,6 +9,9 @@ dpkg (1.16.15+nmu1) UNRELEASED; urgency=low
   * Fix memory leaks in buffer_copy() on error conditions.
   * Fix possible out of bounds buffer read access in the error output on
     bogus ar member sizes.
+  * Fix file triggers/Unincorp descriptor leak on subprocesses. Regression
+    introduced with the initial triggers implementation in dpkg 1.14.17.
+    Closes: #751021
 
   [ Updated scripts translations ]
   * Fix typos in German (Helge Kreutzmann)
diff --git a/lib/dpkg/trigdeferred.l b/lib/dpkg/trigdeferred.l
index 28e8ed6..6e9cf59 100644
--- a/lib/dpkg/trigdeferred.l
+++ b/lib/dpkg/trigdeferred.l
@@ -169,6 +169,8 @@ trigdef_update_start(enum trigdef_updateflags uf)
 			pop_cleanup(ehflag_normaltidy);
 			return tdus_error_no_deferred;
 		}
+	} else {
+		setcloexec(fileno(old_deferred), fn.buf);
 	}
 
 	if (uf & tduf_write) {
@@ -179,6 +181,8 @@ trigdef_update_start(enum trigdef_updateflags uf)
 		if (!trig_new_deferred)
 			ohshite(_("unable to open/create new triggers deferred file `%.250s'"),
 			        newfn.buf);
+
+		setcloexec(fileno(trig_new_deferred), newfn.buf);
 	}
 
 	if (!old_deferred)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/dpkg.git



More information about the Reproducible-commits mailing list