I want a git repository, accessible over ssh, to be read-only when used with certain keys. With other keys access to the full system is okay.
Here is my solution.
if echo "$2" | egrep -q ^git-upload-pack; then sh -c "$2" else echo Error: read only access 1>&2 fi
command="./git-readonlyshell -c \"$SSH_ORIGINAL_COMMAND\"" ...
Any scenario in which this would break?