Просмотр исходного кода

* apt-pkg/deb/dpkgpm.cc:
- ensure that history.log gets closed to avoid leaking a FD
(closes: #601649)

Michael Vogt лет назад: 15
Родитель
Сommit
fd8bb61d29
2 измененных файлов с 4 добавлено и 0 удалено
  1. 1 0
      apt-pkg/deb/dpkgpm.cc
  2. 3 0
      debian/changelog

+ 1 - 0
apt-pkg/deb/dpkgpm.cc

@@ -660,6 +660,7 @@ bool pkgDPkgPM::OpenLog()
       if (term_out == NULL)
 	 return _error->WarningE("OpenLog", _("Could not open file '%s'"), logfile_name.c_str());
       setvbuf(term_out, NULL, _IONBF, 0);
+      SetCloseExec(fileno(term_out), true);
       chmod(logfile_name.c_str(), 0600);
       fprintf(term_out, "\nLog started: %s\n", timestr);
    }

+ 3 - 0
debian/changelog

@@ -15,6 +15,9 @@ apt (0.8.7) UNRELEASED; urgency=low
   * apt-pkg/deb/debsystem.cc:
     - fix issues with dir::state::status and dir::state::extended_states
       when alternative rootdirs are used
+  * apt-pkg/deb/dpkgpm.cc:
+    - ensure that history.log gets closed to avoid leaking a FD
+      (closes: #601649)
 
   [ Martin Pitt ]
   * apt-pkg/deb/debindexfile.cc: