summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2014-06-09 19:38:05 +0200
committerGuillem Jover <guillem@debian.org>2014-08-09 22:14:34 +0200
commit92ab1bb69c3f251a2811015d94d1933b3b39e43a (patch)
tree7f6f3c2e6c18344b7cb5cdf46730345af95188a3 /lib
parent73bc422dee4accae89e800d50cb79068e77a7c31 (diff)
downloaddpkg-92ab1bb69c3f251a2811015d94d1933b3b39e43a.tar.gz
libdpkg: Fix file triggers/Unincorp descriptor leak on subprocesses
Regression introduced in commit 10440009b68f59eeed4cb1b56547e3cf356aa540, with the initial triggers implementation. Closes: #751021
Diffstat (limited to 'lib')
-rw-r--r--lib/dpkg/trigdeferred.l4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/dpkg/trigdeferred.l b/lib/dpkg/trigdeferred.l
index a886055a2..d422bbd4d 100644
--- a/lib/dpkg/trigdeferred.l
+++ b/lib/dpkg/trigdeferred.l
@@ -161,6 +161,8 @@ trigdef_update_start(enum trigdef_update_flags uf)
struct stat stab;
int rc;
+ setcloexec(fileno(old_deferred), fn.buf);
+
rc = fstat(fileno(old_deferred), &stab);
if (rc < 0)
ohshite(_("unable to stat triggers deferred file `%.250s'"),
@@ -180,6 +182,8 @@ trigdef_update_start(enum trigdef_update_flags 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)