Merge branch 'mr/doc-clean-f-f' into maint
[gitweb.git] / t / t5570-git-daemon.sh
index 3eb7d3186e161d2aa3a2fa872c014ad31dd91de0..b7e283252d7d73e937ef87096801f2d252e95961 100755 (executable)
@@ -157,5 +157,16 @@ test_expect_success 'access repo via interpolated hostname' '
                git clone --bare "$GIT_DAEMON_URL/interp.git" tmp.git
 '
 
+test_expect_success 'hostname cannot break out of directory' '
+       rm -rf tmp.git &&
+       repo="$GIT_DAEMON_DOCUMENT_ROOT_PATH/../escape.git" &&
+       git init --bare "$repo" &&
+       git push "$repo" HEAD &&
+       >"$repo"/git-daemon-export-ok &&
+       test_must_fail \
+               env GIT_OVERRIDE_VIRTUAL_HOST=.. \
+               git clone --bare "$GIT_DAEMON_URL/escape.git" tmp.git
+'
+
 stop_git_daemon
 test_done