runshell: Avoid failing when $HOME/.ssh does not exist and cannot be created.

This commit is contained in:
Joey Hess 2015-11-10 11:42:06 -04:00
parent 428ffc14cc
commit 3e49f9fcab
Failed to extract signature
3 changed files with 18 additions and 12 deletions

2
debian/changelog vendored
View file

@ -16,6 +16,8 @@ git-annex (5.20151102.2) UNRELEASED; urgency=medium
recover. recover.
* quvi may output utf-8 encoded data when the conifigured locale doesn't * quvi may output utf-8 encoded data when the conifigured locale doesn't
support that; avoid crashing on such invalid encoding. support that; avoid crashing on such invalid encoding.
* runshell: Avoid failing when $HOME/.ssh does not exist and cannot be
created.
-- Joey Hess <id@joeyh.name> Wed, 04 Nov 2015 12:50:20 -0400 -- Joey Hess <id@joeyh.name> Wed, 04 Nov 2015 12:50:20 -0400

View file

@ -64,12 +64,14 @@ fi
# And this shim is used by the webapp when adding a remote ssh server. # And this shim is used by the webapp when adding a remote ssh server.
if [ ! -e "$HOME/.ssh/git-annex-wrapper" ]; then if [ ! -e "$HOME/.ssh/git-annex-wrapper" ]; then
mkdir "$HOME/.ssh" >/dev/null 2>&1 || true mkdir "$HOME/.ssh" >/dev/null 2>&1 || true
( if [ -e "$HOME/.ssh" ]; then
echo "#!/bin/sh" (
echo "set -e" echo "#!/bin/sh"
echo "exec '$base/runshell' \"\$@\"" echo "set -e"
) > "$HOME/.ssh/git-annex-wrapper" echo "exec '$base/runshell' \"\$@\""
chmod +x "$HOME/.ssh/git-annex-wrapper" ) > "$HOME/.ssh/git-annex-wrapper"
chmod +x "$HOME/.ssh/git-annex-wrapper"
fi
fi fi
# Put our binaries first, to avoid issues with out of date or incompatable # Put our binaries first, to avoid issues with out of date or incompatable

View file

@ -50,12 +50,14 @@ fi
# And this shim is used by the webapp when adding a remote ssh server. # And this shim is used by the webapp when adding a remote ssh server.
if [ ! -e "$HOME/.ssh/git-annex-wrapper" ]; then if [ ! -e "$HOME/.ssh/git-annex-wrapper" ]; then
mkdir "$HOME/.ssh" >/dev/null 2>&1 || true mkdir "$HOME/.ssh" >/dev/null 2>&1 || true
( if [ -e "$HOME/.ssh" ]; then
echo "#!/bin/sh" (
echo "set -e" echo "#!/bin/sh"
echo "exec '$base/runshell' \"\$@\"" echo "set -e"
) > "$HOME/.ssh/git-annex-wrapper" echo "exec '$base/runshell' \"\$@\""
chmod +x "$HOME/.ssh/git-annex-wrapper" ) > "$HOME/.ssh/git-annex-wrapper"
chmod +x "$HOME/.ssh/git-annex-wrapper"
fi
fi fi
# Put our binaries first, to avoid issues with out of date or incompatable # Put our binaries first, to avoid issues with out of date or incompatable