From 6a4f9b6eb378072baeb576b1d986076929fcc82b Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Tue, 2 Jul 2013 20:07:03 -0700 Subject: [PATCH] Require GIT_PROJECT_ROOT to be set to use git-http-backend-verify --- bin/git-http-backend-verify | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/bin/git-http-backend-verify b/bin/git-http-backend-verify index 72d556c..dc81594 100755 --- a/bin/git-http-backend-verify +++ b/bin/git-http-backend-verify @@ -6,6 +6,8 @@ # Set GIT_HTTP_BACKEND_BIN to change the default http-backend binary from # the default of Config.pm $git_http_backend_bin (which itself has a default # of "/usr/lib/git-core/git-http-backend") +# +# Note that GIT_PROJECT_ROOT must be set to use this script. set -e @@ -51,6 +53,17 @@ msglines() done } +internalerr() +{ + errorhdrs 500 Internal Server Error + if [ $# -eq 0 ]; then + msglines "Internal Server Error" + else + msglines "$@" + fi + exit 0 +} + forbidden() { errorhdrs 403 Forbidden @@ -73,6 +86,8 @@ needsauth() exit 0 } +[ -n "$GIT_PROJECT_ROOT" ] || { internalerr 'GIT_PROJECT_ROOT must be set'; exit 1; } + proj= needscheck= pathcheck="${PATH_INFO#/}" -- 2.11.4.GIT