From f89d6dd33eb0cf85823be4c17df83a7be0fc1ece Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 29 Oct 2012 14:40:28 -0400 Subject: [PATCH] The standalone tarball's runshell now takes care of installing a ~/.ssh/git-annex-shell wrapper the first time it's run. --- debian/changelog | 2 ++ standalone/linux/runshell | 13 +++++++++++++ 2 files changed, 15 insertions(+) diff --git a/debian/changelog b/debian/changelog index 7acdb38eec..34d8199494 100644 --- a/debian/changelog +++ b/debian/changelog @@ -31,6 +31,8 @@ git-annex (3.20121018) UNRELEASED; urgency=low pushed to about pushes. * rsync special remote: Include annex-rsync-options when running rsync to test a key's presence. + * The standalone tarball's runshell now takes care of installing a + ~/.ssh/git-annex-shell wrapper the first time it's run. -- Joey Hess Wed, 17 Oct 2012 14:24:10 -0400 diff --git a/standalone/linux/runshell b/standalone/linux/runshell index da26cd3ba9..82d3ce2c52 100755 --- a/standalone/linux/runshell +++ b/standalone/linux/runshell @@ -26,6 +26,19 @@ cd "$base" base="$(pwd)" cd "$orig" +# Install shim that's used to run git-annex-shell from ssh authorized_keys. +# The assistant also does this when run, but the user may not be using the +# assistant. +if [ ! -e "$HOME/.ssh/git-annex-shell" ]; then + mkdir "$HOME/.ssh" >/dev/null 2>&1 || true + ( + echo "#!/bin/sh" + echo "set -e" + echo "exec $base/runshell git-annex-shell -c \"\$SSH_ORIGINAL_COMMAND\"" + ) > "$HOME/.ssh/git-annex-shell" + chmod +x "$HOME/.ssh/git-annex-shell" +fi + # Put our binaries first, to avoid issues with out of date or incompatable # system binaries. PATH=$base/bin:$PATH