Przeglądaj źródła

libdpkg: Set umask to 0 when creating symlinks in test suite to normalize results

POSIX specifies that symlinks have undefined permissions in their mode,
so their setting is system dependent. Linux does not honor the umask
for symlinks, other systems like Hurd or kFreeBSD do, which means we
get different results due to this.

Regression introduced in commit f71e02c8e913884bfbf9d97b58ded4591b823cdb.

Closes: #764171
Guillem Jover 11 lat temu
rodzic
commit
0ccf9ad229
2 zmienionych plików z 14 dodań i 1 usunięć
  1. 5 0
      debian/changelog
  2. 9 1
      lib/dpkg/test/t-tar.t

+ 5 - 0
debian/changelog

@@ -4,6 +4,11 @@ dpkg (1.17.16) UNRELEASED; urgency=low
   * Switch remaining topic to named variable in Dpkg::Source::Patch:analyze(),
     otherwise the loop was expecting values in one variable but storing them
     in another. Regression introduced in dpkg 1.17.14. Closes: #764206
+  * Set umask to 0 when creating symlinks in tar test case, to normalize
+    results. POSIX specifies that symlinks have undefined permissions in
+    their mode, so their setting is system dependent. Linux does not honor
+    the umask for symlinks, other systems like Hurd or kFreeBSD do.
+    Regression introduced in dpkg 1.17.14. Closes: #764171
 
  -- Guillem Jover <guillem@debian.org>  Mon, 06 Oct 2014 03:37:15 +0200
 

+ 9 - 1
lib/dpkg/test/t-tar.t

@@ -59,13 +59,21 @@ sub tar_create_tree {
     make_path("$long_a/$long_b/$long_c/$long_d/$long_e/");
     make_path("$long_a/$long_b/$long_c/$long_d/$long_e/$long_f/");
     create("$long_a/$long_b/$long_c/$long_d/$long_e/$long_f/long");
+
+    # POSIX specifies that symlinks have undefined permissions in their
+    # mode, so their handling is system dependent. Linux does not honor
+    # the umask for symlinks, other systems like GNU/Hurd or kFreeBSD do,
+    # which means we get different results due to this.
+    my $umask = umask 0;
+
     symlink "$long_a/$long_b/$long_c/$long_d/$long_e/$long_f/long",
             'symlink-long';
-
     symlink 'file', 'symlink-a';
     symlink 'hardlink', 'symlink-b';
     symlink 'dangling', 'symlink-c';
 
+    umask $umask;
+
     mkdir 'directory';
     mkfifo('fifo', 0770);