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

fix crash in order writing in pkgDPkgPM::WriteApportReport()

libapt can be configured to write various bits of information to a file
creating a report via apport. This is disabled by default in Debian and
apport residing only in /experimental so far, but Ubuntu and other
derivatives have this (in some versions) enabled by default and there is
no regression potentially here.

The crash is caused by a mismatch of operations vs. strings for
operations, so adding the missing strings for these operations solves
the problem.

[commit message by David Kalnischkies]

LP: #1436626
Michael Vogt лет назад: 11
Родитель
Сommit
3af3768e1a
1 измененных файлов с 9 добавлено и 2 удалено
  1. 9 2
      apt-pkg/deb/dpkgpm.cc

+ 9 - 2
apt-pkg/deb/dpkgpm.cc

@@ -1900,8 +1900,15 @@ void pkgDPkgPM::WriteApportReport(const char *pkgpath, const char *errormsg)
       }
    }
 
-   // log the ordering 
-   const char *ops_str[] = {"Install", "Configure","Remove","Purge"};
+   // log the ordering, see dpkgpm.h and the "Ops" enum there
+   const char *ops_str[] = {
+      "Install",
+      "Configure",
+      "Remove",
+      "Purge",
+      "ConfigurePending",
+      "TriggersPending",
+   };
    fprintf(report, "AptOrdering:\n");
    for (vector<Item>::iterator I = List.begin(); I != List.end(); ++I)
       if ((*I).Pkg != NULL)