From 34b2ef6f3896d54436c24282c39145c5ee5c45c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Reynolds?= Date: Wed, 11 Sep 2013 01:27:16 -0300 Subject: A bit more secure --- git-shell-commands/delete-repo | 3 +++ 1 file changed, 3 insertions(+) diff --git a/git-shell-commands/delete-repo b/git-shell-commands/delete-repo index 17804c6..075f77a 100755 --- a/git-shell-commands/delete-repo +++ b/git-shell-commands/delete-repo @@ -6,8 +6,11 @@ set -e for repo in $@; do +# Remove leading slashes and dots and perform cleanup + repo="`echo "$repo" | sed -e "s,^[/\.]\+,,g" -e "s,[^a-z0-9\./_-],,gi"`" test ! -d "$repo".git && continue + echo "Removing ${repo}.git" # lo and behold absolute horror rm -rf "$repo".git done -- cgit v1.1-4-g5e80