From: Guillem Jover Date: Wed, 4 Jun 2008 05:07:31 +0000 (+0300) Subject: Close --status-fd file descriptors on exec X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=99bdd01410f56782bcfe785552a60058fe9cad88;p=dpkg Close --status-fd file descriptors on exec This avoids those being inherited by the childs. Closes: #471488 --- diff --git a/ChangeLog b/ChangeLog index d5472875..01a9675a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-06-04 Guillem Jover + + * src/main.c (setpipe): Set file descriptors to close on exec. + 2008-06-04 Guillem Jover * dpkg-deb/build.c (getfi): Use m_realloc instead of realloc. diff --git a/debian/changelog b/debian/changelog index 16032060..d07c995e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -15,6 +15,8 @@ dpkg (1.15.0) UNRELEASED; urgency=low * Fix the support for passing more than one --status-fd option to dpkg. Until now only the last one was being used. * Replace realloc plus error checking usage with m_realloc. + * Close --status-fd file descriptors on exec, so that they are not + inherited by the childs. Closes: #471488 [ Raphael Hertzog ] * Enhance dpkg-shlibdeps's error message when a library can't be found to diff --git a/src/main.c b/src/main.c index 61029510..a248cf4d 100644 --- a/src/main.c +++ b/src/main.c @@ -300,6 +300,8 @@ static void setpipe(const struct cmdinfo *cip, const char *value) { if (*ep || v > INT_MAX) badusage(_("invalid integer for --%s: `%.250s'"),cip->olong,value); + setcloexec(v, _("")); + pipe_new = nfmalloc(sizeof(struct pipef)); pipe_new->fd = v; pipe_new->next = *pipe_head;