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

dpkg: Defer symlink renames to avoid ending up with broken symlinks

The broken symlinks are particularly pernicious as they imply a shared
library SONAME path might point to nowhere and thus applications will
fail to get dynamically linked.

Deferring symlinks is safe as they are always at the end of the tar
archive, and they are processed last on deferred renames as they are
appended at the end of the new list files.

Closes: #605536
Guillem Jover лет назад: 15
Родитель
Сommit
a766f501f6
2 измененных файлов с 6 добавлено и 1 удалено
  1. 5 0
      debian/changelog
  2. 1 1
      src/archives.c

+ 5 - 0
debian/changelog

@@ -1,5 +1,10 @@
 dpkg (1.15.8.7) UNRELEASED; urgency=low
 
+  [ Guillem Jover ]
+  * Defer symlink renames so that there's never a point were a symlink
+    is broken, this is particularly important for shared libraries.
+    Closes: #605536
+
   [ Updated manpage translations ]
   * French (Christian Perrier).
 

+ 1 - 1
src/archives.c

@@ -827,7 +827,7 @@ tarobject(void *ctx, struct tar_entry *ti)
    * in dpkg-new.
    */
 
-  if (ti->type == tar_filetype_file) {
+  if (ti->type == tar_filetype_file || ti->type == tar_filetype_symlink) {
     nifd->namenode->flags |= fnnf_deferred_rename;
 
     debug(dbg_eachfiledetail, "tarobject done and installation deferred");