summaryrefslogtreecommitdiff
path: root/src/run
diff options
context:
space:
mode:
authorGravatar Matthias Lucas Jaros <jarlucmat@mailbox.org>2025-10-26 08:39:37 +0100
committerGravatar Matthias Lucas Jaros <jarlucmat@mailbox.org>2025-10-26 08:39:37 +0100
commit7dd18234861d3de62e1ddd2887f7bdb9e2b891c6 (patch)
treed03c6c7ea6303e21c212ce4fc5723b565c0ef781 /src/run
parent80b4d4065fe7cd259d767b4439db7ed0da23880a (diff)
Enhanced jail_escape logic and allowed also dots for repo names. Fixed - in repo names
Diffstat (limited to 'src/run')
-rwxr-xr-xsrc/run7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/run b/src/run
index 4e95098..360244c 100755
--- a/src/run
+++ b/src/run
@@ -19,10 +19,11 @@ set -l repo $matcher[2]
# adjust repo path to /srv/repos
set -l repoDir /(string join -n '/' srv repos (string split '/' $repo))
-# check repo jail in /srv/repos
-if not string match -r -q -- "/srv/repos/.*" "(realpath $repoDir)"
+# check if realPath is in jail under /srv/repos
+set -l realPath (realpath $repoDir)
+if not string match -r -q -- "/srv/repos/.*" "$realPath"
# something is for sure wrong here
- echo "$(date -Is): DENY jail_escape user=$currentUser ip=$SSH_CONNECTION argv=$argv" &>>$_LOG
+ echo "$(date -Is): DENY jail_escape user=$currentUser ip=$SSH_CONNECTION realPath=$realPath argv=$argv" &>>$_LOG
exit 2
end