aboutsummaryrefslogtreecommitdiffstats
path: root/setup.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2023-05-15 13:59:03 -0700
committerJunio C Hamano <gitster@pobox.com>2023-05-15 13:59:03 -0700
commitfa889347e3c26dc49963b4261a5231e9c158599f (patch)
tree57cd58a08573a9d566f5e7aa941d54237b2e4758 /setup.c
parentMerge branch 'mc/send-email-header-cmd' (diff)
parentsetup: trace bare repository setups (diff)
downloadgit-fa889347e3c26dc49963b4261a5231e9c158599f.tar.gz
git-fa889347e3c26dc49963b4261a5231e9c158599f.zip
Merge branch 'gc/trace-bare-repo-setup'
The tracing mechanism learned to notice and report when auto-discovered bare repositories are being used, as allowing so without explicitly stating the user intends to do so (with setting GIT_DIR for example) can be used with social engineering as an attack vector. * gc/trace-bare-repo-setup: setup: trace bare repository setups
Diffstat (limited to 'setup.c')
-rw-r--r--setup.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/setup.c b/setup.c
index 59abc16ba6..458582207e 100644
--- a/setup.c
+++ b/setup.c
@@ -1352,6 +1352,7 @@ static enum discovery_result setup_git_directory_gently_1(struct strbuf *dir,
}
if (is_git_directory(dir->buf)) {
+ trace2_data_string("setup", NULL, "implicit-bare-repository", dir->buf);
if (get_allowed_bare_repo() == ALLOWED_BARE_REPO_EXPLICIT)
return GIT_DIR_DISALLOWED_BARE;
if (!ensure_valid_ownership(NULL, NULL, dir->buf, report))