mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 13:56:01 +03:00
225 lines
3.4 KiB
Perl
225 lines
3.4 KiB
Perl
### Empty
|
|
{
|
|
type => "tfn",
|
|
name => "normalisePath",
|
|
input => "",
|
|
output => "",
|
|
ret => 0,
|
|
},
|
|
|
|
### Nothing
|
|
{
|
|
type => "tfn",
|
|
name => "normalisePath",
|
|
input => "/foo/bar/baz",
|
|
output => "/foo/bar/baz",
|
|
ret => 0,
|
|
},
|
|
{
|
|
type => "tfn",
|
|
name => "normalisePath",
|
|
input => "/foo/bar\0/baz",
|
|
output => "/foo/bar\0/baz",
|
|
ret => 0,
|
|
},
|
|
|
|
### Basic
|
|
{
|
|
type => "tfn",
|
|
name => "normalisePath",
|
|
input => "x",
|
|
output => "x",
|
|
ret => 0,
|
|
},
|
|
{
|
|
type => "tfn",
|
|
name => "normalisePath",
|
|
input => ".",
|
|
output => "",
|
|
ret => 1,
|
|
},
|
|
{
|
|
type => "tfn",
|
|
name => "normalisePath",
|
|
input => "./",
|
|
output => "",
|
|
ret => 1,
|
|
},
|
|
{
|
|
type => "tfn",
|
|
name => "normalisePath",
|
|
input => "./..",
|
|
output => "..",
|
|
ret => 1,
|
|
},
|
|
{
|
|
type => "tfn",
|
|
name => "normalisePath",
|
|
input => "./../",
|
|
output => "../",
|
|
ret => 1,
|
|
},
|
|
{
|
|
type => "tfn",
|
|
name => "normalisePath",
|
|
input => "..",
|
|
output => "..",
|
|
ret => 0,
|
|
},
|
|
{
|
|
type => "tfn",
|
|
name => "normalisePath",
|
|
input => "../",
|
|
output => "../",
|
|
ret => 0,
|
|
},
|
|
{
|
|
type => "tfn",
|
|
name => "normalisePath",
|
|
input => "../.",
|
|
output => "..",
|
|
ret => 1,
|
|
},
|
|
{
|
|
type => "tfn",
|
|
name => "normalisePath",
|
|
input => ".././",
|
|
output => "../",
|
|
ret => 1,
|
|
},
|
|
{
|
|
type => "tfn",
|
|
name => "normalisePath",
|
|
input => "../..",
|
|
output => "../..",
|
|
ret => 0,
|
|
},
|
|
{
|
|
type => "tfn",
|
|
name => "normalisePath",
|
|
input => "../../",
|
|
output => "../../",
|
|
ret => 0,
|
|
},
|
|
{
|
|
type => "tfn",
|
|
name => "normalisePath",
|
|
input => "/dir/foo//bar",
|
|
output => "/dir/foo/bar",
|
|
ret => 1,
|
|
},
|
|
{
|
|
type => "tfn",
|
|
name => "normalisePath",
|
|
input => "dir/foo//bar/",
|
|
output => "dir/foo/bar/",
|
|
ret => 1,
|
|
},
|
|
{
|
|
type => "tfn",
|
|
name => "normalisePath",
|
|
input => "dir/../foo",
|
|
output => "foo",
|
|
ret => 1,
|
|
},
|
|
{
|
|
type => "tfn",
|
|
name => "normalisePath",
|
|
input => "dir/../../foo",
|
|
output => "../foo",
|
|
ret => 1,
|
|
},
|
|
{
|
|
type => "tfn",
|
|
name => "normalisePath",
|
|
input => "dir/./.././../../foo/bar",
|
|
output => "../../foo/bar",
|
|
ret => 1,
|
|
},
|
|
{
|
|
type => "tfn",
|
|
name => "normalisePath",
|
|
input => "dir/./.././../../foo/bar/.",
|
|
output => "../../foo/bar",
|
|
ret => 1,
|
|
},
|
|
{
|
|
type => "tfn",
|
|
name => "normalisePath",
|
|
input => "dir/./.././../../foo/bar/./",
|
|
output => "../../foo/bar/",
|
|
ret => 1,
|
|
},
|
|
{
|
|
type => "tfn",
|
|
name => "normalisePath",
|
|
input => "dir/./.././../../foo/bar/..",
|
|
output => "../../foo",
|
|
ret => 1,
|
|
},
|
|
{
|
|
type => "tfn",
|
|
name => "normalisePath",
|
|
input => "dir/./.././../../foo/bar/../",
|
|
output => "../../foo/",
|
|
ret => 1,
|
|
},
|
|
{
|
|
type => "tfn",
|
|
name => "normalisePath",
|
|
input => "dir/./.././../../foo/bar/",
|
|
output => "../../foo/bar/",
|
|
ret => 1,
|
|
},
|
|
{
|
|
type => "tfn",
|
|
name => "normalisePath",
|
|
input => "dir//.//..//.//..//..//foo//bar",
|
|
output => "../../foo/bar",
|
|
ret => 1,
|
|
},
|
|
{
|
|
type => "tfn",
|
|
name => "normalisePath",
|
|
input => "dir//.//..//.//..//..//foo//bar//",
|
|
output => "../../foo/bar/",
|
|
ret => 1,
|
|
},
|
|
{
|
|
type => "tfn",
|
|
name => "normalisePath",
|
|
input => "dir/subdir/subsubdir/subsubsubdir/../../..",
|
|
output => "dir",
|
|
ret => 1,
|
|
},
|
|
{
|
|
type => "tfn",
|
|
name => "normalisePath",
|
|
input => "dir/./subdir/./subsubdir/./subsubsubdir/../../..",
|
|
output => "dir",
|
|
ret => 1,
|
|
},
|
|
{
|
|
type => "tfn",
|
|
name => "normalisePath",
|
|
input => "dir/./subdir/../subsubdir/../subsubsubdir/..",
|
|
output => "dir",
|
|
ret => 1,
|
|
},
|
|
{
|
|
type => "tfn",
|
|
name => "normalisePath",
|
|
input => "/dir/./subdir/../subsubdir/../subsubsubdir/../",
|
|
output => "/dir/",
|
|
ret => 1,
|
|
},
|
|
|
|
### With NUL
|
|
{
|
|
type => "tfn",
|
|
name => "normalisePath",
|
|
input => "/./.././../../../../../../../\0/../etc/./passwd",
|
|
output => "/etc/passwd",
|
|
ret => 1,
|
|
},
|