Selaa lähdekoodia

dpkg: Error out if a database .list file is not a regular file

LP: #369898

Signed-off-by: Guillem Jover <guillem@debian.org>
Raphaël Hertzog 14 vuotta sitten
vanhempi
commit
c07f7fea42
2 muutettua tiedostoa jossa 5 lisäystä ja 0 poistoa
  1. 1 0
      debian/changelog
  2. 4 0
      src/filesdb.c

+ 1 - 0
debian/changelog

@@ -57,6 +57,7 @@ dpkg (1.16.2) UNRELEASED; urgency=low
     dependencies for another architecture. This is really basic for now since
     it assumes all build dependencies must be satisfied on the listed
     architecture. Closes: #648180 Thanks to Colin Watson for the patch.
+  * Error out if a dpkg database .list file is not a regular file. LP: #369898
 
   [ Jonathan Nieder ]
   * Bump po4a version in Build-Depends to 0.41, since earlier versions do

+ 4 - 0
src/filesdb.c

@@ -325,6 +325,10 @@ ensure_packagefiles_available(struct pkginfo *pkg)
      ohshite(_("unable to stat files list file for package '%.250s'"),
              pkg->set->name);
 
+  if (!S_ISREG(stat_buf.st_mode))
+    ohshit(_("files list for package '%.250s' is not a regular file"),
+           pkg->set->name);
+
    if (stat_buf.st_size) {
      loaded_list = nfmalloc(stat_buf.st_size);
      loaded_list_end = loaded_list + stat_buf.st_size;