summaryrefslogtreecommitdiff
path: root/Assistant/Ssh.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Assistant/Ssh.hs')
-rw-r--r--Assistant/Ssh.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/Assistant/Ssh.hs b/Assistant/Ssh.hs
index 4c8d8afbf..98b21b13b 100644
--- a/Assistant/Ssh.hs
+++ b/Assistant/Ssh.hs
@@ -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