commit 1c3b8d8407b94c563ed225bf897129187eb93fbc
parent 5c2535357362b96f22739bd2a6b68e0dfba336d8
Author: Matthias Jaros <jaros@mailbox.org>
Date: Sun, 19 Oct 2025 18:30:47 +0200
Added check for git command
Diffstat:
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/run b/run
@@ -2,9 +2,16 @@
set REPO_PERMISSIONS /etc/repo-permissions
set GIT_COMMAND_REGEX "^(git-(?:upload-pack|receive-pack|upload-archive)) '((?:\/[a-zA-Z-]+)+.git)'\$"
+
+# check given git command
+set -l matcher (string match -r -g $GIT_COMMAND_REGEX "$argv")
+if test (count $matcher) -ne 2
+ # there should be two groups otherwise something is wrong
+ exit 1
+end
+
# echo check for permissions
set -l checkUser (whoami)
-set -l matcher (string match -r -g $GIT_COMMAND_REGEX "$argv")
set -l gitCommand $matcher[1]
set -l repo $matcher[2]
set -l repoDir srv repos