assistant: Fix ~/.ssh/git-annex-shell wrapper to work when the ssh key does not force a command.

Without a forced command, SSH_ORIGINAL_COMMAND is not set.
So instead, in this case, run $@
This commit is contained in:
Joey Hess 2013-03-12 07:12:39 -04:00
parent e5f812c4c3
commit 796f1d806f
3 changed files with 19 additions and 7 deletions

View file

@ -127,8 +127,13 @@ addAuthorizedKeysCommand rsynconly dir pubkey = join "&&"
script =
[ shebang
, "set -e"
, "exec git-annex-shell -c \"$SSH_ORIGINAL_COMMAND\""
, "if [ \"x$SSH_ORIGINAL_COMMAND\" != \"x\" ]; then"
, runshell "$SSH_ORIGINAL_COMMAND"
, "else"
, runshell "$@"
, "fi"
]
runshell var = "exec git-annex-shell -c \"" ++ var ++ "\""
authorizedKeysLine :: Bool -> FilePath -> SshPubKey -> String
authorizedKeysLine rsynconly dir pubkey