]> git.saurik.com Git - apt.git/commitdiff
merged from lp:~donkult/apt/sid
authorMichael Vogt <michael.vogt@ubuntu.com>
Fri, 20 Apr 2012 08:37:04 +0000 (10:37 +0200)
committerMichael Vogt <michael.vogt@ubuntu.com>
Fri, 20 Apr 2012 08:37:04 +0000 (10:37 +0200)
apt-inst/contrib/extracttar.cc
apt-pkg/deb/dpkgpm.cc
debian/changelog

index 12919a7cd8bc9800fa6418cffb00a41e9e9671f3..806ba796d687833839b3f52020facfe68e40ce94 100644 (file)
@@ -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;
 }
index 496daf1df4799a1a27ba29c8e999309ec6aec0ca..296426c80f478f05065afe2642d047d6ae0baaf8 100644 (file)
@@ -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"))
index 18242e081ae4c35ee49307b92c449549a1e03da5..2f5a3dc5c34b7d0dea2b5e96be773a11c6afb1ec 100644 (file)
@@ -1,7 +1,13 @@
-apt (0.9.2) unstable; urgency=low
+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)
 
   [ David Kalnischkies ]
-  * apt-pkg/deb/deblistparser.cc:
+   * apt-pkg/deb/deblistparser.cc:
     - only treat the native apt as essential by default (Closes: #669377)
   * apt-pkg/contrib/fileutl.cc:
     - redirect stderr from compressors to /dev/null
@@ -16,6 +22,12 @@ apt (0.9.2) unstable; urgency=low
     - actually return to the fallback modifier if we have detected we
       should for packagenames which look like modifiers (Closes: #669591)
 
+  [ 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)
 
   [ Malcolm Scott ]
   * apt-pkg/packagemanager.cc: