index : builder | |
Archlinux32 build system | gitolite user |
summaryrefslogtreecommitdiff |
author | Erich Eckner <git@eckner.net> | 2018-02-06 20:52:56 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2018-02-06 20:52:56 +0100 |
commit | 31dfe057f9b5667991f3c7809a13a87485f32ac6 (patch) | |
tree | dcb2b28f2810cf7e7be4dfb2e18f661f64c9128e /bin/slave-build-connect | |
parent | 86823d203d23536386d7c01356e2a5a6df810adf (diff) |
-rwxr-xr-x | bin/slave-build-connect | 7 |
diff --git a/bin/slave-build-connect b/bin/slave-build-connect index 2ca72a3..119592e 100755 --- a/bin/slave-build-connect +++ b/bin/slave-build-connect @@ -3,11 +3,12 @@ # shellcheck source=conf/default.conf . "${0%/*}/../conf/default.conf" -if [ "${SSH_ORIGINAL_COMMAND%% *}" = "get-assignment" ] || \ - [ "${SSH_ORIGINAL_COMMAND%% *}" = "return-assignment" ]; then +if [ "x${SSH_ORIGINAL_COMMAND%% *}" = 'xget-assignment' ] || \ + [ "x${SSH_ORIGINAL_COMMAND%% *}" = 'xreturn-assignment' ] || \ + [ "x${SSH_ORIGINAL_COMMAND%% *}" = 'xping-from-slave' ]; then # small check to prevent some shell-injections - if echo "${SSH_ORIGINAL_COMMAND}" | \ + if printf '%s\n' "${SSH_ORIGINAL_COMMAND}" | \ grep -q '[^-a-zA-Z0-9.+_ ]'; then >&2 printf 'Invalid command: "%s".\n' "${SSH_ORIGINAL_COMMAND}" |