summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2012-04-20 09:18:26 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2012-04-20 09:18:26 +0200
commit8c6d0ba4e25baa7b0dffc4e06e76fc63a71e656f (patch)
treec7256864e89df2aaaabdb2a0640e692022a882aa
parent66d404e36661301bd7482c75351111d5bea2905b (diff)
parentd4621f8277a76f3e5c87b06f7abd93df04446efc (diff)
merge from the lp:~mvo/apt/mvo branch
-rw-r--r--apt-inst/contrib/extracttar.cc2
-rw-r--r--apt-pkg/deb/dpkgpm.cc6
-rw-r--r--debian/changelog17
3 files changed, 23 insertions, 2 deletions
diff --git a/apt-inst/contrib/extracttar.cc b/apt-inst/contrib/extracttar.cc
index 12919a7cd..806ba796d 100644
--- a/apt-inst/contrib/extracttar.cc
+++ b/apt-inst/contrib/extracttar.cc
@@ -146,7 +146,7 @@ bool ExtractTar::StartGzip()
}
// Fix up our FDs
- InFd.Fd(Pipes[0]);
+ InFd.OpenDescriptor(Pipes[0], FileFd::ReadOnly, FileFd::None, true);
close(Pipes[1]);
return true;
}
diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc
index 496daf1df..296426c80 100644
--- a/apt-pkg/deb/dpkgpm.cc
+++ b/apt-pkg/deb/dpkgpm.cc
@@ -738,6 +738,7 @@ bool pkgDPkgPM::OpenLog()
d->history_out = fopen(history_name.c_str(),"a");
if (d->history_out == NULL)
return _error->WarningE("OpenLog", _("Could not open file '%s'"), history_name.c_str());
+ SetCloseExec(fileno(d->history_out), true);
chmod(history_name.c_str(), 0644);
fprintf(d->history_out, "\nStart-Date: %s\n", timestr);
string remove, purge, install, reinstall, upgrade, downgrade;
@@ -1596,7 +1597,10 @@ void pkgDPkgPM::WriteApportReport(const char *pkgpath, const char *errormsg)
const char *ops_str[] = {"Install", "Configure","Remove","Purge"};
fprintf(report, "AptOrdering:\n");
for (vector<Item>::iterator I = List.begin(); I != List.end(); ++I)
- fprintf(report, " %s: %s\n", (*I).Pkg.Name(), ops_str[(*I).Op]);
+ if ((*I).Pkg != NULL)
+ fprintf(report, " %s: %s\n", (*I).Pkg.Name(), ops_str[(*I).Op]);
+ else
+ fprintf(report, " %s: %s\n", "NULL", ops_str[(*I).Op]);
// attach dmesg log (to learn about segfaults)
if (FileExists("/bin/dmesg"))
diff --git a/debian/changelog b/debian/changelog
index 8eca51cc4..f401f312c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,20 @@
+apt (0.9.2) UNRELEASED; urgency=low
+
+ [ Michael Vogt ]
+ * apt-inst/contrib/extracttar.cc:
+ - ensure that in StartGzip the InFd is set to "AutoClose" to ensure
+ that the pipe is closed when InFd is closed. This fixes a Fd leak
+ (LP: #985452)
+
+ [ Adam Conrad ]
+ * Set FD_CLOEXEC on history.log's FD (Closes: #610069, LP: #636010)
+
+ [ Thorsten Spindler ]
+ * apt-pkg/deb/dpkgpm.cc:
+ - do not crash if (*I).Pkg is NULL (LP: #939867)
+
+ -- Michael Vogt <michael.vogt@ubuntu.com> Fri, 20 Apr 2012 09:13:19 +0200
+
apt (0.9.1) unstable; urgency=low
[ David Kalnischkies ]