patch-lib_Archive_Zip_Member_pm 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. $OpenBSD: patch-lib_Archive_Zip_Member_pm,v 1.3 2016/11/02 22:28:52 jasper Exp $
  2. http://rt.cpan.org/Public/Bug/Display.html?id=61930
  3. --- lib/Archive/Zip/Member.pm.orig Thu Aug 11 22:06:33 2016
  4. +++ lib/Archive/Zip/Member.pm Wed Nov 2 20:27:03 2016
  5. @@ -304,7 +304,7 @@ sub _mapPermissionsToUnix {
  6. if ($format == FA_AMIGA) {
  7. $attribs = $attribs >> 17 & 7; # Amiga RWE bits
  8. $mode = $attribs << 6 | $attribs << 3 | $attribs;
  9. - return $mode;
  10. + return sprintf("%d", $mode);
  11. }
  12. if ($format == FA_THEOS) {
  13. @@ -324,7 +324,10 @@ sub _mapPermissionsToUnix {
  14. || $format == FA_QDOS
  15. || $format == FA_TANDEM) {
  16. $mode = $attribs >> 16;
  17. - return $mode if $mode != 0 or not $self->localExtraField;
  18. + if( $mode != 0 or not $self->localExtraField) {
  19. + $mode = sprintf("%d", $mode);
  20. + return sprintf("%d", $mode);
  21. + }
  22. # warn("local extra field is: ", $self->localExtraField, "\n");
  23. @@ -360,9 +363,13 @@ sub _mapPermissionsToUnix {
  24. # keep previous $mode setting when its "owner"
  25. # part appears to be consistent with DOS attribute flags!
  26. - return $mode if ($mode & 0700) == (0400 | $attribs << 6);
  27. + if( ( $mode & 0700 ) == ( 0400 | $attribs << 6 )) {
  28. + $mode = sprintf("%d", $mode);
  29. + return sprintf("%d", $mode);
  30. + }
  31. $mode = 0444 | $attribs << 6 | $attribs << 3 | $attribs;
  32. - return $mode;
  33. + $mode = sprintf("%d", $mode);
  34. + return sprintf("%d", $mode);
  35. }
  36. sub unixFileAttributes {