Przeglądaj źródła

dpkg: Do not write to the available file when unpacking binary packages

This information is not useful as dpkg has never recorded the archive
path, so it has never been truly available for re-installation anyway.

Only write to it if recording the information from the binary package
to the available file via --record-avail.
Guillem Jover 12 lat temu
rodzic
commit
840d33bf1d
2 zmienionych plików z 14 dodań i 5 usunięć
  1. 3 0
      debian/changelog
  2. 11 5
      src/archives.c

+ 3 - 0
debian/changelog

@@ -21,6 +21,9 @@ dpkg (1.17.11) UNRELEASED; urgency=low
   * When parsing the statoverride database from dpkg-statoverride do not
     consider it an error and refuse to operate at all if the user or group
     names are not known to the system, just preserve them. Closes: #563307
+  * Do not write to the available file when unpacking binary packages. This
+    information is not useful as dpkg has never recorded the archive path,
+    so it has never been truly available for re-installation anyway.
 
   [ Updated programs translations ]
   * Danish (Joe Dalton). Closes: #754127

+ 11 - 5
src/archives.c

@@ -1543,14 +1543,20 @@ archivefiles(const char *const *argv)
   const char *volatile thisarg;
   const char *const *volatile argp;
   jmp_buf ejbuf;
+  enum modstatdb_rw msdbflags;
 
   trigproc_install_hooks();
 
-  modstatdb_open(f_noact ?                          msdbrw_readonly :
-                 (cipaction->arg_int == act_avail ? msdbrw_readonly :
-                  fc_nonroot ?                      msdbrw_write :
-                                                    msdbrw_needsuperuser) |
-                 msdbrw_available_write);
+  if (f_noact)
+    msdbflags = msdbrw_readonly;
+  else if (cipaction->arg_int == act_avail)
+    msdbflags = msdbrw_readonly | msdbrw_available_write;
+  else if (fc_nonroot)
+    msdbflags = msdbrw_write;
+  else
+    msdbflags = msdbrw_needsuperuser;
+
+  modstatdb_open(msdbflags);
 
   checkpath();
   pkg_infodb_upgrade();