aboutsummaryrefslogtreecommitdiff
path: root/standalone
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-11-10 12:53:46 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-11-10 12:53:46 -0400
commitc6cf025cddba51b622751947e701c74f468cba2f (patch)
treee57169994614c92f98ffccff1fab767a9bafde7b /standalone
parent96f6a72577595faad00f31b214ae25e3bec4b5b3 (diff)
Make the git-annex-standalone.deb prevent runshell from installing wrappers into $HOME/.ssh
Diffstat (limited to 'standalone')
-rwxr-xr-xstandalone/linux/skel/runshell60
1 files changed, 33 insertions, 27 deletions
diff --git a/standalone/linux/skel/runshell b/standalone/linux/skel/runshell
index 68a462266..8c1db4247 100755
--- a/standalone/linux/skel/runshell
+++ b/standalone/linux/skel/runshell
@@ -42,35 +42,41 @@ if echo "$base" | grep -q '[:;]'; then
trap cleanuptbase EXIT
fi
-# 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
- if [ -e "$HOME/.ssh" ]; then
- (
- echo "#!/bin/sh"
- echo "set -e"
- echo "if [ \"x\$SSH_ORIGINAL_COMMAND\" != \"x\" ]; then"
- echo "exec '$base/runshell' git-annex-shell -c \"\$SSH_ORIGINAL_COMMAND\""
- echo "else"
- echo "exec '$base/runshell' git-annex-shell -c \"\$@\""
- echo "fi"
- ) > "$HOME/.ssh/git-annex-shell"
- chmod +x "$HOME/.ssh/git-annex-shell"
+# Set this variable when using this script inside a package of git-annex,
+# which arranges for git-annex, git-annex-shell, and git to all be in the
+# standard PATH.
+GIT_ANNEX_PACKAGE_INSTALL=
+if [ -z "$GIT_ANNEX_PACKAGE_INSTALL" ]; then
+ # 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
+ if [ -e "$HOME/.ssh" ]; then
+ (
+ echo "#!/bin/sh"
+ echo "set -e"
+ echo "if [ \"x\$SSH_ORIGINAL_COMMAND\" != \"x\" ]; then"
+ echo "exec '$base/runshell' git-annex-shell -c \"\$SSH_ORIGINAL_COMMAND\""
+ echo "else"
+ echo "exec '$base/runshell' git-annex-shell -c \"\$@\""
+ echo "fi"
+ ) > "$HOME/.ssh/git-annex-shell"
+ chmod +x "$HOME/.ssh/git-annex-shell"
+ fi
fi
-fi
-# And this shim is used by the webapp when adding a remote ssh server.
-if [ ! -e "$HOME/.ssh/git-annex-wrapper" ]; then
- mkdir "$HOME/.ssh" >/dev/null 2>&1 || true
- if [ -e "$HOME/.ssh" ]; then
- (
- echo "#!/bin/sh"
- echo "set -e"
- echo "exec '$base/runshell' \"\$@\""
- ) > "$HOME/.ssh/git-annex-wrapper"
- chmod +x "$HOME/.ssh/git-annex-wrapper"
+ # And this shim is used by the webapp when adding a remote ssh server.
+ if [ ! -e "$HOME/.ssh/git-annex-wrapper" ]; then
+ mkdir "$HOME/.ssh" >/dev/null 2>&1 || true
+ if [ -e "$HOME/.ssh" ]; then
+ (
+ echo "#!/bin/sh"
+ echo "set -e"
+ echo "exec '$base/runshell' \"\$@\""
+ ) > "$HOME/.ssh/git-annex-wrapper"
+ chmod +x "$HOME/.ssh/git-annex-wrapper"
+ fi
fi
fi