aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/perl/perl/fixes/extutils_file_path_compat.diff
blob: f1ef61de1876d0eadfb36c7680ce42ba6f6c2839 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
From 4636b3bfd2ccdacc60da0e7a858c6c5a4e0cb659 Mon Sep 17 00:00:00 2001
From: James E Keenan <jkeenan@cpan.org>
Date: Thu, 11 May 2017 04:23:40 -0400
Subject: [PATCH] Correct the order of tests of chmod(). (#294)

Per code review by haarg, the order of tests was wrong in the first place.
Hence, correctly re-ordering them is a better repair than changing one test's
description.

For: https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker/pull/294

[Debian note: this is a prerequisite for the CVE-2017-6512 fix in
File-Path]

Bug: https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker/pull/294
Patch-Name: fixes/extutils_file_path_compat.diff

---
 cpan/ExtUtils-MakeMaker/t/eu_command.t | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/cpan/ExtUtils-MakeMaker/t/eu_command.t b/cpan/ExtUtils-MakeMaker/t/eu_command.t
index 269aa5c..32a6f59 100644
--- a/cpan/ExtUtils-MakeMaker/t/eu_command.t
+++ b/cpan/ExtUtils-MakeMaker/t/eu_command.t
@@ -151,20 +151,21 @@ BEGIN {
         is( ((stat('testdir'))[2] & 07777) & 0700,
             0100, 'change a dir to execute-only' );
 
-        # change a dir to read-only
-        @ARGV = ( '0400', 'testdir' );
+        # change a dir to write-only
+        @ARGV = ( '0200', 'testdir' );
         ExtUtils::Command::chmod();
 
         is( ((stat('testdir'))[2] & 07777) & 0700,
-            0400, 'change a dir to read-only' );
+            0200, 'change a dir to write-only' );
 
-        # change a dir to write-only
-        @ARGV = ( '0200', 'testdir' );
+        # change a dir to read-only
+        @ARGV = ( '0400', 'testdir' );
         ExtUtils::Command::chmod();
 
         is( ((stat('testdir'))[2] & 07777) & 0700,
-            0200, 'change a dir to write-only' );
+            0400, 'change a dir to read-only' );
 
+        # remove the dir we've been playing with
         @ARGV = ('testdir');
         rm_rf;
         ok( ! -e 'testdir', 'rm_rf can delete a read-only dir' );