commit 35ed60befe996e5ccb01f66e3156d8dfece6869d parent 20b96f7710ce97372a32cdb8b8f899c3be9bf315 Author: Matthias Jaros <jaros@mailbox.org> Date: Sat, 15 Nov 2025 18:09:40 +0100 Refactoring Diffstat:
| M | src/git-run | | | 14 | +++++++------- |
| M | src/version | | | 4 | ++-- |
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git 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 @@ -1 +1 @@ -1.2 -\ No newline at end of file +1.3-SNAPSHOT +\ No newline at end of file