Test that incoming paths cannot contain /../

This commit is contained in:
Tommi Virtanen 2008-03-19 21:28:46 +02:00
parent e1d150daf5
commit f7bcd554fa

View file

@ -57,6 +57,18 @@ def test_bad_unsafeArguments():
eq(str(e), 'Arguments to command look dangerous')
assert isinstance(e, serve.ServingError)
def test_bad_unsafeArguments_dotdot():
cfg = RawConfigParser()
e = assert_raises(
serve.UnsafeArgumentsError,
serve.serve,
cfg=cfg,
user='jdoe',
command='git-upload-pack something/../evil',
)
eq(str(e), 'Arguments to command look dangerous')
assert isinstance(e, serve.ServingError)
def test_bad_forbiddenCommand_read():
cfg = RawConfigParser()
e = assert_raises(