Explorar el Código

dpkg-source/2.0 and 3.0 (quilt): fix perms of automatic patch

* scripts/Dpkg/Source/Package/V2.pm (do_build): Change permissions
of the automatically generated patch which is initially created
0600 with tempfile().
Raphael Hertzog hace 18 años
padre
commit
2469869937
Se han modificado 3 ficheros con 9 adiciones y 1 borrados
  1. 3 0
      ChangeLog
  2. 3 0
      debian/changelog
  3. 3 1
      scripts/Dpkg/Source/Package/V2.pm

+ 3 - 0
ChangeLog

@@ -6,6 +6,9 @@
 	quilt command might create it). Up to now
 	File::Spec->rel2abs(undef) returned the name of the current
 	directory and we improperly used that as value of QUILT_SERIES.
+	* scripts/Dpkg/Source/Package/V2.pm (do_build): Change permissions
+	of the automatically generated patch which is initially created
+	0600 with tempfile().
 
 2008-08-26  Guillem Jover  <guillem@debian.org>
 

+ 3 - 0
debian/changelog

@@ -5,6 +5,9 @@ dpkg (1.14.22) UNRELEASED; urgency=low
     "3.0 (quilt)" format when they have local changes and no pre-existing
     quilt series file. Now always provide a valid name in QUILT_SERIES.
     Closes: #496920
+  * Fix permissions of the automatically generated pacth in "2.0" and "3.0
+    (quilt)" format. They were improperly set to 0600 due to tempfile()
+    and were not reset to a sane value. Closes: #496925
 
   [ Updated dpkg translations ]
   * Brazilian Portuguese (Felipe Augusto van de Wiel).

+ 3 - 1
scripts/Dpkg/Source/Package/V2.pm

@@ -337,7 +337,7 @@ sub do_build {
     $diff->add_diff_directory($tmp, $dir, basedirname => $basedirname,
             %{$self->{'diff_options'}}, handle_binary_func => $handle_binary);
     error(_g("unrepresentable changes to source")) if not $diff->finish();
-    # The previous auto-patch must be removed, it has not been used and it
+    # The previous auto-patch must be removed, it has not been used and it
     # will be recreated if it's still needed
     my $autopatch = File::Spec->catfile($dir, "debian", "patches",
                                         $self->get_autopatch_name());
@@ -356,6 +356,8 @@ sub do_build {
         }
         rename($tmpdiff, $autopatch) ||
                 syserr(_g("cannot rename %s to %s"), $tmpdiff, $autopatch);
+        chmod(0666 & ~ umask(), $autopatch) ||
+                syserr(_g("unable to change permission of `%s'"), $autopatch);
     }
     $self->register_autopatch($dir);
     pop @Dpkg::Exit::handlers;