From d4e71a2321f04b590d58eb2292934214c20a4bca Mon Sep 17 00:00:00 2001 From: Michael Brantley Date: Thu, 10 May 2018 06:47:31 -0400 Subject: [PATCH] perlPackages.Paranoid: init at 2.05 --- .../perl-modules/Paranoid-blessed-path.patch | 23 +++++++++++++++++++ pkgs/top-level/perl-packages.nix | 19 +++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 pkgs/development/perl-modules/Paranoid-blessed-path.patch diff --git a/pkgs/development/perl-modules/Paranoid-blessed-path.patch b/pkgs/development/perl-modules/Paranoid-blessed-path.patch new file mode 100644 index 00000000000..5e800250110 --- /dev/null +++ b/pkgs/development/perl-modules/Paranoid-blessed-path.patch @@ -0,0 +1,23 @@ +diff -ru Paranoid-2.05/lib/Paranoid.pm /tmp/Paranoid-2.05/lib/Paranoid.pm +--- Paranoid-2.05/lib/Paranoid.pm 2017-02-06 05:48:57.000000000 -0500 ++++ /tmp/Paranoid-2.05/lib/Paranoid.pm 2018-05-10 06:40:35.286313299 -0400 +@@ -61,7 +61,7 @@ + + my $path = shift; + +- $path = '/bin:/usr/bin' unless defined $path; ++ $path = '__BLESSED_PATH__' unless defined $path; + + delete @ENV{qw(IFS CDPATH ENV BASH_ENV)}; + $ENV{PATH} = $path; +Binary files Paranoid-2.05/lib/.Paranoid.pm.swp and /tmp/Paranoid-2.05/lib/.Paranoid.pm.swp differ +diff -ru Paranoid-2.05/t/01_init_core.t /tmp/Paranoid-2.05/t/01_init_core.t +--- Paranoid-2.05/t/01_init_core.t 2016-07-12 04:49:33.000000000 -0400 ++++ /tmp/Paranoid-2.05/t/01_init_core.t 2018-05-10 06:43:41.323183381 -0400 +@@ -35,5 +35,5 @@ + ok( psecureEnv('/bin:/sbin'), 'psecureEnv 1' ); + is( $ENV{PATH}, '/bin:/sbin', 'Validated PATH' ); + ok( psecureEnv(), 'psecureEnv 2' ); +-is( $ENV{PATH}, '/bin:/usr/bin', 'Validated PATH' ); ++is( $ENV{PATH}, '__BLESSED_PATH__', 'Validated PATH' ); + diff --git a/pkgs/top-level/perl-packages.nix b/pkgs/top-level/perl-packages.nix index 22733443ed1..5237f2a2c8e 100644 --- a/pkgs/top-level/perl-packages.nix +++ b/pkgs/top-level/perl-packages.nix @@ -11954,6 +11954,25 @@ let self = _self // overrides; _self = with self; { }; }; + Paranoid = buildPerlPackage rec { + name = "Paranoid-2.05"; + src = fetchurl { + url = "mirror://cpan/authors/id/C/CO/CORLISS/Paranoid/${name}.tar.gz"; + sha256 = "583dfa0279733531f360795ad1cf4aa652d537b2b0bbd3c6925d0c8d75cbb3df"; + }; + patches = [ ../development/perl-modules/Paranoid-blessed-path.patch ]; + preConfigure = '' + # Capture the path used when compiling this module as the "blessed" + # system path, analogous to the module's own use of '/bin:/sbin'. + sed -i "s#__BLESSED_PATH__#$PATH#" lib/Paranoid.pm t/01_init_core.t + ''; + meta = { + description = "General function library for safer, more secure programming"; + license = with stdenv.lib.licenses; [ artistic1 gpl1Plus ]; + maintainers = [ maintainers.limeytexan ]; + }; + }; + PARDist = buildPerlPackage { name = "PAR-Dist-0.49"; src = fetchurl {