소스 검색

Close --status-fd file descriptors on exec

This avoids those being inherited by the childs. Closes: #471488
Guillem Jover 18 년 전
부모
커밋
99bdd01410
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-06-04  Guillem Jover  <guillem@debian.org>
+
+	* src/main.c (setpipe): Set file descriptors to close on exec.
+
 2008-06-04  Guillem Jover  <guillem@debian.org>
 
 	* dpkg-deb/build.c (getfi): Use m_realloc instead of realloc.

+ 2 - 0
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

+ 2 - 0
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, _("<package status and progress file descriptor>"));
+
   pipe_new = nfmalloc(sizeof(struct pipef));
   pipe_new->fd = v;
   pipe_new->next = *pipe_head;