Skip to content

Commit af8282d

Browse files
gitsterdscho
authored andcommitted
Revert "fetch/clone: detect dubious ownership of local repositories"
This partially reverts f4aa8c8 (fetch/clone: detect dubious ownership of local repositories, 2024-04-10) that broke typical read-only use cases (e.g. by git-daemon serving fetches and clones) where "nobody" who has no write permission serves repositories owned by others. The function to die upon seeing dubious ownership is still kept, as there are other users of it, but calls to it from the generic repository discovery code path, which triggered in cases far wider than originally intended (i.e. to stop local clones), have been removed. Signed-off-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent 5c576e8 commit af8282d

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

path.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,6 @@ const char *enter_repo(const char *path, int strict)
840840
if (!suffix[i])
841841
return NULL;
842842
gitfile = read_gitfile(used_path.buf);
843-
die_upon_dubious_ownership(gitfile, NULL, used_path.buf);
844843
if (gitfile) {
845844
strbuf_reset(&used_path);
846845
strbuf_addstr(&used_path, gitfile);
@@ -851,7 +850,6 @@ const char *enter_repo(const char *path, int strict)
851850
}
852851
else {
853852
const char *gitfile = read_gitfile(path);
854-
die_upon_dubious_ownership(gitfile, NULL, path);
855853
if (gitfile)
856854
path = gitfile;
857855
if (chdir(path))

t/t0411-clone-from-partial.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ test_expect_success 'create evil repo' '
2323
>evil/.git/shallow
2424
'
2525

26-
test_expect_success 'local clone must not fetch from promisor remote and execute script' '
26+
test_expect_failure 'local clone must not fetch from promisor remote and execute script' '
2727
rm -f script-executed &&
2828
test_must_fail git clone \
2929
--upload-pack="GIT_TEST_ASSUME_DIFFERENT_OWNER=true git-upload-pack" \
@@ -33,7 +33,7 @@ test_expect_success 'local clone must not fetch from promisor remote and execute
3333
test_path_is_missing script-executed
3434
'
3535

36-
test_expect_success 'clone from file://... must not fetch from promisor remote and execute script' '
36+
test_expect_failure 'clone from file://... must not fetch from promisor remote and execute script' '
3737
rm -f script-executed &&
3838
test_must_fail git clone \
3939
--upload-pack="GIT_TEST_ASSUME_DIFFERENT_OWNER=true git-upload-pack" \
@@ -43,7 +43,7 @@ test_expect_success 'clone from file://... must not fetch from promisor remote a
4343
test_path_is_missing script-executed
4444
'
4545

46-
test_expect_success 'fetch from file://... must not fetch from promisor remote and execute script' '
46+
test_expect_failure 'fetch from file://... must not fetch from promisor remote and execute script' '
4747
rm -f script-executed &&
4848
test_must_fail git fetch \
4949
--upload-pack="GIT_TEST_ASSUME_DIFFERENT_OWNER=true git-upload-pack" \

0 commit comments

Comments
 (0)