To fix test with ports privsep, create temp file in /tmp.
This commit is contained in:
parent
c130d45e0d
commit
33ff18a3cd
|
@ -1,14 +1,17 @@
|
|||
COMMENT = cryptographic CipherSaber encryption
|
||||
|
||||
DISTNAME = Crypt-CipherSaber-1.01
|
||||
CATEGORIES = security
|
||||
REVISION = 0
|
||||
|
||||
CATEGORIES = security
|
||||
|
||||
# Perl
|
||||
PERMIT_PACKAGE = Yes
|
||||
|
||||
MODULES = cpan
|
||||
PKG_ARCH = *
|
||||
TEST_DEPENDS = devel/p5-Test-Warn
|
||||
MODULES = cpan
|
||||
|
||||
TEST_DEPENDS = devel/p5-Test-Warn
|
||||
|
||||
PKG_ARCH = *
|
||||
|
||||
.include <bsd.port.mk>
|
||||
|
|
38
security/p5-Crypt-CipherSaber/patches/patch-t_bigfile_t
Normal file
38
security/p5-Crypt-CipherSaber/patches/patch-t_bigfile_t
Normal file
|
@ -0,0 +1,38 @@
|
|||
Ports privsep does not allow to write into t directory.
|
||||
|
||||
Index: t/bigfile.t
|
||||
--- t/bigfile.t.orig
|
||||
+++ t/bigfile.t
|
||||
@@ -1,25 +1,25 @@
|
||||
#!perl -w
|
||||
|
||||
-BEGIN
|
||||
-{
|
||||
- chdir 't' if -d 't';
|
||||
-}
|
||||
-
|
||||
use strict;
|
||||
+use File::Temp qw(tempfile);
|
||||
use Test::More tests => 2;
|
||||
|
||||
use_ok( 'Crypt::CipherSaber' );
|
||||
|
||||
+my ($fh, $filename) = tempfile(UNLINK => 1,
|
||||
+ TEMPLATE => "/tmp/smiles.png.XXXXXXXXXX");
|
||||
+chdir 't' or die "Couldn't chdir: $!";
|
||||
+
|
||||
my $cs = Crypt::CipherSaber->new( 'sdrawkcabsihtdaeR' );
|
||||
open( INPUT, 'smiles.cs1' ) or die "Couldn't open: $!";
|
||||
binmode(INPUT);
|
||||
-open(OUTPUT, '> smiles.png') or die "Couldn't open: $!";
|
||||
+open(OUTPUT, '>&', $fh) or die "Couldn't open: $!";
|
||||
binmode(OUTPUT);
|
||||
$cs->fh_crypt(\*INPUT, \*OUTPUT);
|
||||
close INPUT;
|
||||
close OUTPUT;
|
||||
|
||||
-open(TEST, 'smiles.png') or die "Couldn't open: $!";
|
||||
+open(TEST, $filename) or die "Couldn't open: $!";
|
||||
my $line = <TEST>;
|
||||
|
||||
like( $line, qr/PNG/, 'Encrypting a large file should not mangle it' );
|
Loading…
Reference in New Issue
Block a user