Subject: | Fails to build in directories containing characters such as '+' |
When built in a directory which includes, for example '+', tests in
t/13restricted.t fail:
# Failed test 'allow to read sample dir in restricted mode'
# at t/13restricted.t line 63.
# got: '0'
# expected: anything else
# Failed test 'allow to read sample dir in restricted mode'
# at t/13restricted.t line 64.
# got: '1'
# expected: '0'
# Looks like you failed 2 tests of 12.
t/13restricted.t ....
Dubious, test returned 2 (wstat 512, 0x200)
Patch (supplied by Niko Tyni) attached.
Originally found at
<http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=613199>
Subject: | 0001-Don-t-pass-the-full-path-of-the-file-to-parse-in-res.patch |
>From 081a0062757db6862e529d6b4b2e48145ec42647 Mon Sep 17 00:00:00 2001
From: Niko Tyni <ntyni@debian.org>
Date: Fri, 6 May 2011 18:03:59 +0300
Subject: [PATCH] Don't pass the full path of the file to parse() in
restricted mode
If the build directory name contains characters like '+', tests 11
and 12 of t/13restricted.t fail because the opensp library considers
the directory unsafe and skips it.
(see PosixStorageManager::isSafe() in lib/PosixStorage.cxx of
opensp-1.5.2)
---
t/13restricted.t | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/t/13restricted.t b/t/13restricted.t
index ea91f25..2bb095d 100755
--- a/t/13restricted.t
+++ b/t/13restricted.t
@@ -53,7 +53,7 @@ isnt($h8->{ok2}, 0, 'must not read paths with ./');
$h8->{ok1} = 0;
$h8->{ok2} = 0;
-my $sd = File::Spec->catfile(File::Spec->rel2abs('.'), 'samples');
+my $sd = 'samples';
$p->search_dirs($sd);
--
1.7.4.4