aboutsummaryrefslogtreecommitdiff
path: root/path.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-12-10 10:04:55 +0900
committerJunio C Hamano <gitster@pobox.com>2024-12-10 10:04:55 +0900
commit35f40385e441d5aa885f5aa813539d5ed9dc2d26 (patch)
tree07dbb374eaef5dbdff5a0ad6369232f975acd570 /path.h
parent9cd1e2e1a0350a3b6cbc4bcd268f0cbbe8c89687 (diff)
parent0ffb5a6bf1b0fd9ce0c0b1fd9ce9fd30b89a2563 (diff)
downloadgit-35f40385e441d5aa885f5aa813539d5ed9dc2d26.tar.xz
Merge branch 'bc/allow-upload-pack-from-other-people'
Loosen overly strict ownership check introduced in the recent past, to keep the promise "cloning a suspicious repository is a safe first step to inspect it". * bc/allow-upload-pack-from-other-people: Allow cloning from repositories owned by another user
Diffstat (limited to 'path.h')
-rw-r--r--path.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/path.h b/path.h
index e91d19fff6..5f6c85e5f8 100644
--- a/path.h
+++ b/path.h
@@ -156,7 +156,22 @@ int calc_shared_perm(int mode);
int adjust_shared_perm(const char *path);
char *interpolate_path(const char *path, int real_home);
-const char *enter_repo(const char *path, int strict);
+
+/* The bits are as follows:
+ *
+ * - ENTER_REPO_STRICT: callers that require exact paths (as opposed
+ * to allowing known suffixes like ".git", ".git/.git" to be
+ * omitted) can set this bit.
+ *
+ * - ENTER_REPO_ANY_OWNER_OK: callers that are willing to run without
+ * ownership check can set this bit.
+ */
+enum {
+ ENTER_REPO_STRICT = (1<<0),
+ ENTER_REPO_ANY_OWNER_OK = (1<<1),
+};
+
+const char *enter_repo(const char *path, unsigned flags);
const char *remove_leading_path(const char *in, const char *prefix);
const char *relative_path(const char *in, const char *prefix, struct strbuf *sb);
int normalize_path_copy_len(char *dst, const char *src, int *prefix_len);