summaryrefslogtreecommitdiff
path: root/config/services/git/shell-commands/repo/src/lib/check-realpath.sh
diff options
context:
space:
mode:
Diffstat (limited to 'config/services/git/shell-commands/repo/src/lib/check-realpath.sh')
-rw-r--r--config/services/git/shell-commands/repo/src/lib/check-realpath.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/config/services/git/shell-commands/repo/src/lib/check-realpath.sh b/config/services/git/shell-commands/repo/src/lib/check-realpath.sh
new file mode 100644
index 0000000..c344bd2
--- /dev/null
+++ b/config/services/git/shell-commands/repo/src/lib/check-realpath.sh
@@ -0,0 +1,9 @@
+check-realpath() {
+ local path="$1"
+ if [[ ! -e "$path" ]] \
+ || [[ ! "$path" == /srv/git/* ]]
+ then
+ red "Forbidden path."
+ exit 2
+ fi
+}