summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2010-10-28 21:11:52 +0200
committerMichael Vogt <mvo@debian.org>2010-10-28 21:11:52 +0200
commitc1fa50e1502b2f3ab2ec44cad00c3af3f910615a (patch)
treedfd844244b00b6f3ebd3eda11e8e2f33eae50bdf /apt-pkg
parent95fe33dc131bee1a0917ba647e44855c10083ab5 (diff)
parentfd8bb61d2945d2e2f19f0e0a753129235717a9f3 (diff)
* apt-pkg/deb/dpkgpm.cc:
- ensure that history.log gets closed to avoid leaking a FD (closes: #601649)
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/deb/dpkgpm.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc
index 395c3fb1a..9f0da3be6 100644
--- a/apt-pkg/deb/dpkgpm.cc
+++ b/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);
}