mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 19:24:29 +03:00
Some more reorg of tests.
This commit is contained in:
98
apache2/t/tfn/normalisePath.t
Normal file
98
apache2/t/tfn/normalisePath.t
Normal file
@@ -0,0 +1,98 @@
|
||||
### 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 => "/foo/bar//baz",
|
||||
output => "/foo/bar/baz",
|
||||
ret => 1,
|
||||
},
|
||||
{
|
||||
type => "tfn",
|
||||
name => "normalisePath",
|
||||
input => "/foo/bar baz/././././boo//eek/././../whoa",
|
||||
output => "/foo/bar baz/boo/whoa",
|
||||
ret => 1,
|
||||
},
|
||||
{
|
||||
type => "tfn",
|
||||
name => "normalisePath",
|
||||
input => "./foo/bar baz/././././boo//eek/././../whoa",
|
||||
output => "./foo/bar baz/boo/whoa",
|
||||
ret => 1,
|
||||
},
|
||||
{
|
||||
type => "tfn",
|
||||
name => "normalisePath",
|
||||
input => "/./foo/bar baz/././././boo//eek/././../whoa",
|
||||
output => "/foo/bar baz/boo/whoa",
|
||||
ret => 1,
|
||||
},
|
||||
{
|
||||
type => "tfn",
|
||||
name => "normalisePath",
|
||||
input => "//foo/bar baz/././././boo//eek/././../whoa",
|
||||
output => "/foo/bar baz/boo/whoa",
|
||||
ret => 1,
|
||||
},
|
||||
{
|
||||
type => "tfn",
|
||||
name => "normalisePath",
|
||||
input => "//foo/bar baz/././././boo//eek/././../whoa/./",
|
||||
output => "/foo/bar baz/boo/whoa/",
|
||||
ret => 1,
|
||||
},
|
||||
{
|
||||
type => "tfn",
|
||||
name => "normalisePath",
|
||||
input => "/./foo/bar baz/././././boo//eek/././../whoa//",
|
||||
output => "/foo/bar baz/boo/whoa/",
|
||||
ret => 1,
|
||||
},
|
||||
{
|
||||
type => "tfn",
|
||||
name => "normalisePath",
|
||||
input => "/./../../../../../../../../etc/passwd",
|
||||
output => "/etc/passwd",
|
||||
ret => 1,
|
||||
},
|
||||
{
|
||||
type => "tfn",
|
||||
name => "normalisePath",
|
||||
input => "/./.././../../../../../../../etc/../etc/./passwd",
|
||||
output => "/etc/passwd",
|
||||
ret => 1,
|
||||
},
|
||||
|
||||
### With NUL
|
||||
{
|
||||
type => "tfn",
|
||||
name => "normalisePath",
|
||||
input => "/./.././../../../../../../../\0/../etc/./passwd",
|
||||
output => "/etc/passwd",
|
||||
ret => 1,
|
||||
},
|
Reference in New Issue
Block a user