File: 22-path-security.t

package info (click to toggle)
libhtml-mason-perl 1%3A1.39-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 2,072 kB
  • ctags: 1,535
  • sloc: perl: 17,624; sh: 187; makefile: 12
file content (25 lines) | stat: -rw-r--r-- 442 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/perl -w

use strict;

use Test::More;

BEGIN
{
    unless ( -f '/etc/passwd' )
    {
        plan skip_all => 'This trest requires that /etc/passwd exist.';
    }
}

plan tests => 1;

use HTML::Mason::Resolver::File;


my $resolver = HTML::Mason::Resolver::File->new();

my $source = $resolver->get_info( '/../../../../../../etc/passwd', 'MAIN', '/var/cache' );

ok( ! $source, 'Cannot get at /etc/passwd with bogus comp path' );