aboutsummaryrefslogtreecommitdiff
path: root/cgit/ssh/git-shell-commands/new
diff options
context:
space:
mode:
Diffstat (limited to 'cgit/ssh/git-shell-commands/new')
-rwxr-xr-xcgit/ssh/git-shell-commands/new1
1 files changed, 1 insertions, 0 deletions
diff --git a/cgit/ssh/git-shell-commands/new b/cgit/ssh/git-shell-commands/new
index ec2d8ca..6b5a03d 100755
--- a/cgit/ssh/git-shell-commands/new
+++ b/cgit/ssh/git-shell-commands/new
@@ -12,6 +12,7 @@ fi
repo_name="$1"; shift 1;
[ -z "$repo_name" ] && echo "Error: empty repo name" 1>&2 && exit 1
+(echo "$repo_name" | grep -q "^[A-Za-z0-9_-]\+$" 2>/dev/null) || (echo "Error: invalid repo name" 1>&2 && exit 1)
# Stupid cmdline parsing means I can't do $1 here for space separated stuff
description="$*"