diff options
Diffstat (limited to 'tests')
| -rwxr-xr-x | tests/t0301-security.sh | 4 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -rwxr-xr-x | tests/t0303-robustness.sh | 10 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
2 files changed, 9 insertions, 5 deletions
diff --git a/tests/t0301-security.sh b/tests/t0301-security.sh index 3df2cee..d9ec265 100755 --- a/tests/t0301-security.sh +++ b/tests/t0301-security.sh @@ -452,10 +452,10 @@ test_expect_success 'a posted length past any buffer is clamped' ' test_expect_success 'the dumb transport refuses a path that climbs out' ' cveq "url=cve/objects/../config" >tmp && - grep "^Status: 400" tmp && + grep "^Status: 404" tmp && ! grep "repositoryformatversion" tmp && cveq "url=cve/objects/info/../../config" >tmp && - grep "^Status: 400" tmp && + grep "^Status: 404" tmp && ! grep "repositoryformatversion" tmp ' diff --git a/tests/t0303-robustness.sh b/tests/t0303-robustness.sh index cbb4cdc..005c6cd 100755 --- a/tests/t0303-robustness.sh +++ b/tests/t0303-robustness.sh @@ -592,9 +592,13 @@ test_expect_success 'the dumb transport sends a file with its size' ' test_expect_success 'the dumb transport withholds the alternates file' ' mkdir -p repos/rob/.git/objects/info && echo "$PWD/repos/foo/.git/objects" >repos/rob/.git/objects/info/alternates && - robq "url=rob/objects/info/alternates" >tmp && - grep "^Status: 404" tmp && - ! grep "repos/foo" tmp && + for path in info/alternates info//alternates info/./alternates ./info/alternates \ + info/Alternates /info/alternates + do + robq "url=rob/objects/$path" >tmp && + grep "^Status: 404" tmp && + ! grep "repos/foo" tmp || return 1 + done && rm repos/rob/.git/objects/info/alternates && robq "url=rob/objects/info/packs" >tmp && grep "^Status: 200" tmp |
