[SCM] Debian packaging of libtest-compile-perl branch, master, updated. 0fbf21f753ec9d7bf8118866447c43d26fcaddf6

Nicholas Bamber nicholas at periapt.co.uk
Sat Nov 19 23:55:05 UTC 2011


The following commit has been merged in the master branch:
commit 0fbf21f753ec9d7bf8118866447c43d26fcaddf6
Author: Nicholas Bamber <nicholas at periapt.co.uk>
Date:   Sat Nov 19 23:47:33 2011 +0000

    * Refreshed copyright and added myself
    * Added patch creating tests for taint mode scripts
      and respecting taint mode (Closes: #649301)

diff --git a/debian/changelog b/debian/changelog
index 8eb7c04..58c487a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -10,8 +10,10 @@ libtest-compile-perl (0.13-2) UNRELEASED; urgency=low
   * Reconsidered short description
   * Created debian/source/format
   * Added myself to Uploaders
-  * Refreshed copyright added myself
+  * Refreshed copyright and added myself
   * Added lintian override about DEP-5
+  * Added patch creating tests for taint mode scripts
+    and respecting taint mode (Closes: #649301)
 
  -- Nicholas Bamber <nicholas at periapt.co.uk>  Wed, 27 Jul 2011 18:48:18 +0200
 
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..6336acc
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+taint.patch
diff --git a/debian/patches/taint.patch b/debian/patches/taint.patch
new file mode 100644
index 0000000..b72a594
--- /dev/null
+++ b/debian/patches/taint.patch
@@ -0,0 +1,52 @@
+Author: Nicholas Bamber <nicholas at periapt.co.uk>
+Subject: taint mode not respected
+Last-Update: 2011-11-19
+Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=649301
+Bug: http://rt.cpan.org/Ticket/Diplay.html?id=55837
+--- /dev/null
++++ b/t/scripts/taint.pl
+@@ -0,0 +1,2 @@
++#!/usr/bin/perl -T
++sleep 1;
+--- /dev/null
++++ b/t/10_taint.t
+@@ -0,0 +1,7 @@
++#!perl -w
++use strict;
++use warnings;
++use Test::More tests => 1;
++use Test::Compile;
++pl_file_ok('t/scripts/taint.pl', 'taint.pl compiles');
++
+--- a/lib/Test/Compile.pm
++++ b/lib/Test/Compile.pm
+@@ -71,7 +71,8 @@
+         $Test->diag("$file does not exist");
+         return;
+     }
+-    my $out = `$^X -cw $file 2>&1`;
++    my $taint = _is_in_taint_mode($file);
++    my $out = `$^X -cw$taint $file 2>&1`;
+     if ($?) {
+         $Test->ok(0, 'Script does not compile');
+         $Test->diag($out);
+@@ -169,6 +170,19 @@
+     return 'script' if -e 'script';
+     return 'bin'    if -e 'bin';
+ }
++
++sub _is_in_taint_mode {
++    my $file = shift;
++    open(FILE, $file) or die "could not open $file";
++    my $shebang = <FILE>;
++    my $taint = undef;
++    if ($shebang =~ /^#![\/\w]+\s+\-w?(T)/) {
++        $taint = $1;
++    }
++    close FILE;
++    return $taint;
++}
++
+ 1;
+ __END__
+ 

-- 
Debian packaging of libtest-compile-perl



More information about the Pkg-perl-cvs-commits mailing list