瀏覽代碼

Close --status-fd file descriptors on exec

This avoids those being inherited by the childs.
Closes: #471488, #487684
Guillem Jover 18 年之前
父節點
當前提交
8fe053cbfd
共有 3 個文件被更改,包括 8 次插入0 次删除
  1. 4 0
      ChangeLog
  2. 2 0
      debian/changelog
  3. 2 0
      src/main.c

+ 4 - 0
ChangeLog

@@ -1,3 +1,7 @@
+2008-08-16  Guillem Jover  <guillem@debian.org>
+
+	* src/main.c (setpipe): Set file descriptors to close on exec.
+
 2008-08-15  Guillem Jover  <guillem@debian.org>
 2008-08-15  Guillem Jover  <guillem@debian.org>
 
 
 	* scripts/dpkg-buildpackage.pl (usage): Fix description of -si option.
 	* scripts/dpkg-buildpackage.pl (usage): Fix description of -si option.

+ 2 - 0
debian/changelog

@@ -15,6 +15,8 @@ dpkg (1.14.21) UNRELEASED; urgency=low
     ruling established in #430649).
     ruling established in #430649).
   * Fix dpkg-source to not use -i and -I by default with "1.0" source
   * Fix dpkg-source to not use -i and -I by default with "1.0" source
     packages. Closes: #495138
     packages. Closes: #495138
+  * Close --status-fd file descriptors on exec, so that they are not
+    inherited by the childs. Closes: #471488, #487684
 
 
   [ Guillem Jover ]
   [ Guillem Jover ]
   * When loading the status file fix up any inconsistent package in state
   * When loading the status file fix up any inconsistent package in state

+ 2 - 0
src/main.c

@@ -299,6 +299,8 @@ static void setpipe(const struct cmdinfo *cip, const char *value) {
   if (*ep || v > INT_MAX)
   if (*ep || v > INT_MAX)
     badusage(_("invalid integer for --%s: `%.250s'"),cip->olong,value);
     badusage(_("invalid integer for --%s: `%.250s'"),cip->olong,value);
 
 
+  setcloexec(v, _("<package status and progress file descriptor>"));
+
   lastpipe= cip->parg;
   lastpipe= cip->parg;
   if (*lastpipe) {
   if (*lastpipe) {
     (*lastpipe)->next= nfmalloc(sizeof(struct pipef));
     (*lastpipe)->next= nfmalloc(sizeof(struct pipef));