From 671b7116373153c6498bffafc7d0312b67ffb069 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 27 Mar 2012 15:14:38 +0200 Subject: * apt-pkg/deb/dpkgpm.cc: - do not crash if (*I).Pkg is NULL (LP: #939867) --- apt-pkg/deb/dpkgpm.cc | 5 ++++- debian/changelog | 7 ++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index c46a81209..be11870fd 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -1595,7 +1595,10 @@ void pkgDPkgPM::WriteApportReport(const char *pkgpath, const char *errormsg) const char *ops_str[] = {"Install", "Configure","Remove","Purge"}; fprintf(report, "AptOrdering:\n"); for (vector::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 2003da5c3..48b63784e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -12,7 +12,12 @@ apt (0.8.16~exp14) UNRELEASED; urgency=low - recheck all dependencies if we changed a package in SmartConfigure as this could break an earlier dependency (LP: #940396) - recheck dependencies in SmartUnpack after a change, too - + + [ Thorsten Spindler ] + * apt-pkg/deb/dpkgpm.cc: + - do not crash if (*I).Pkg is NULL (LP: #939867) + + -- David Kalnischkies Tue, 13 Mar 2012 12:38:35 +0100 apt (0.8.16~exp13) experimental; urgency=low -- cgit v1.2.3-70-g09d2 From 2448a064f33c66d4f698375d30b87201a5a3b103 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 19 Apr 2012 10:54:44 +0200 Subject: * 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) --- apt-inst/contrib/extracttar.cc | 2 +- debian/changelog | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) 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/debian/changelog b/debian/changelog index 48b63784e..50d6ea3ce 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +apt (0.8.16~exp15) unstable; urgency=low + + * 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) + + -- Michael Vogt Thu, 19 Apr 2012 10:53:30 +0200 + apt (0.8.16~exp14) UNRELEASED; urgency=low [ Michael Vogt ] -- cgit v1.2.3-70-g09d2 From d4621f8277a76f3e5c87b06f7abd93df04446efc Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 20 Apr 2012 09:12:56 +0200 Subject: cherry pick r1975 from lp:~ubuntu-core-dev/apt/ubuntu --- apt-pkg/deb/dpkgpm.cc | 1 + debian/changelog | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index be11870fd..14376f649 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; diff --git a/debian/changelog b/debian/changelog index 50d6ea3ce..fa4cdc251 100644 --- a/debian/changelog +++ b/debian/changelog @@ -121,6 +121,12 @@ apt (0.8.16~exp13) experimental; urgency=low -- Michael Vogt Tue, 06 Mar 2012 18:12:57 +0100 +apt (0.8.16~exp12ubuntu8) precise; urgency=low + + * Set FD_CLOEXEC on history.log's FD (Closes: #610069, LP: #636010) + + -- Adam Conrad Thu, 12 Apr 2012 16:26:20 -0600 + apt (0.8.16~exp12) experimental; urgency=low [ Michael Vogt ] -- cgit v1.2.3-70-g09d2