summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Matthias Lucas Jaros <jarlucmat@mailbox.org>2025-11-15 18:09:40 +0100
committerGravatar Matthias Lucas Jaros <jarlucmat@mailbox.org>2025-11-15 18:09:40 +0100
commit2d87065deb00d2b74c93b444b1b770451c20de40 (patch)
treee0407ab66cd60aad3fa9aa6e1816dbad1589d1c9 /src
parent8f5e15403f6eea6554338625e0366452ffe3f6e3 (diff)
Refactoring
Diffstat (limited to 'src')
-rwxr-xr-xsrc/git-run14
-rw-r--r--src/version2
2 files changed, 8 insertions, 8 deletions
diff --git a/src/git-run b/src/git-run
index e89a12a..8a0da81 100755
--- a/src/git-run
+++ b/src/git-run
@@ -15,8 +15,7 @@ end
function verifyGitCommand
# check given git command
# basic form is <git-command> '<path-to-repo>'
- set -l matcher $argv
- if test (count $matcher) -ne 2
+ if test (count $argv) -ne 2
emit log_event DENY bad_format "argv=$argv"
return 1
end
@@ -57,15 +56,16 @@ end
# redirect stdout/stderr to file, no information to potential attacker
begin
- set -l matcher (string match -r -g $_GIT_VALIDATION_REGEX -- "$argv")
- verifyGitCommand $matcher; or exit $status
+ # parse command
+ set -l parsedCommand (string match -r -g $_GIT_VALIDATION_REGEX -- "$argv")
+
+ verifyGitCommand $parsedCommand; or exit $status
# extract variables
- set gitCommand $matcher[1]
- set -l repo $matcher[2]
+ set gitCommand $parsedCommand[1]
# adjust repo path to /srv/repos
- set repoDir /(string join -n '/' srv repos (string split '/' $repo))
+ set repoDir /(string join -n '/' srv repos (string split '/' $parsedCommand[2]))
# check if realPath is in jail under /srv/repos
verifyRepoJail; or exit $status
diff --git a/src/version b/src/version
index ea710ab..6b3ae54 100644
--- a/src/version
+++ b/src/version
@@ -1 +1 @@
-1.2 \ No newline at end of file
+1.3-SNAPSHOT \ No newline at end of file