From: Tarmigan Casebolt Date: Sat, 26 Dec 2009 23:29:13 GMT Subject: [PATCH 2/2] Smart-http: check if repository is OK to export before serving it Message-ID: <1261870153-57572-2-git-send-email-tarmigan+git@gmail.com> In-Reply-To: <1261870153-57572-1-git-send-email-tarmigan+git@gmail.com> Similar to how git-daemon checks whether a repository is OK to be exported, smart-http should also check. This check can be satisfied in two different ways: the environmental variable GIT_HTTP_EXPORT_ALL may be set to export all repositories, or the individual repository may have the file git-daemon-export-ok. Signed-off-by: Tarmigan Casebolt --- http-backend.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/http-backend.c b/http-backend.c index f729488..345c12b 100644 --- a/http-backend.c +++ b/http-backend.c @@ -648,6 +648,9 @@ int main(int argc, char **argv) setup_path(); if (!enter_repo(dir, 0)) not_found("Not a git repository: '%s'", dir); + if (!getenv("GIT_HTTP_EXPORT_ALL") && + access("git-daemon-export-ok", F_OK) ) + not_found("Repository not exported: '%s'", dir); git_config(http_config, NULL); cmd->imp(cmd_arg); -- 1.6.6.2.g5daf2