diff options
| author | Akshay Nair <phenax5@gmail.com> | 2026-07-05 19:38:11 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2026-07-05 19:38:11 +0530 |
| commit | b3d4fe72d35d7542f54b8c81e2f59f66723df1df (patch) | |
| tree | b02f57bf40fe5f7b542f2501067c472e9b6abb04 /cgit | |
| parent | d2fd01c0181fd557a1750d8c36fbe1394431766c (diff) | |
| download | bacchus-remote-b3d4fe72d35d7542f54b8c81e2f59f66723df1df.tar.gz bacchus-remote-b3d4fe72d35d7542f54b8c81e2f59f66723df1df.zip | |
Some hardening
Diffstat (limited to '')
| -rwxr-xr-x | cgit/ssh/git-shell-commands/fork | 1 | ||||
| -rwxr-xr-x | cgit/ssh/git-shell-commands/new | 1 | ||||
| -rwxr-xr-x | cgit/ssh/git-shell-commands/set-description | 1 |
3 files changed, 3 insertions, 0 deletions
diff --git a/cgit/ssh/git-shell-commands/fork b/cgit/ssh/git-shell-commands/fork index 52803d3..c2bc799 100755 --- a/cgit/ssh/git-shell-commands/fork +++ b/cgit/ssh/git-shell-commands/fork @@ -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) remote_repo_url="$1"; shift 1; [ -z "$remote_repo_url" ] && echo "Error: empty repo url" 1>&2 && exit 1 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="$*" diff --git a/cgit/ssh/git-shell-commands/set-description b/cgit/ssh/git-shell-commands/set-description index a120fa0..ea0e52e 100755 --- a/cgit/ssh/git-shell-commands/set-description +++ b/cgit/ssh/git-shell-commands/set-description @@ -9,6 +9,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) description="$*"; [ -z "$description" ] && echo "Error: empty description" 1>&2 && exit 1 |
