Sfoglia il codice sorgente

dpkg: don't ohshite if lutimes() fails with ENOSYS

Glibc implements lutimes() on top of utimensat() which is only provided
by Linux >= 2.6.22. With older kernels it returns ENOSYS.

This regression was introduced by commit
b3eb59cf43c286bb6c906c00ef1cdc0ec21f474d which implemented support for
setting timestamps of symlinks.

Reported-by: Michael Prokop <mika@debian.org>
Raphaël Hertzog 15 anni fa
parent
commit
888a5bbbd9
2 ha cambiato i file con 3 aggiunte e 1 eliminazioni
  1. 2 0
      debian/changelog
  2. 1 1
      src/archives.c

+ 2 - 0
debian/changelog

@@ -2,6 +2,8 @@ dpkg (1.16.0.1) UNRELEASED; urgency=low
 
   [ Raphaël Hertzog ]
   * Fix regression affecting dpkg -R. Closes: #620636
+  * Don't fail during unpack if the system doesn't support changing timestamps
+    of symlinks. Closes: #620679
 
  -- Raphaël Hertzog <hertzog@debian.org>  Sun, 03 Apr 2011 15:06:32 +0200
 

+ 1 - 1
src/archives.c

@@ -242,7 +242,7 @@ tarobject_set_mtime(struct tar_entry *te, const char *path)
 
   if (te->type == tar_filetype_symlink) {
 #ifdef HAVE_LUTIMES
-    if (lutimes(path, tv))
+    if (lutimes(path, tv) && errno != ENOSYS)
       ohshite(_("error setting timestamps of `%.255s'"), path);
 #endif
   } else {