runshell: Avoid failing when $HOME/.ssh does not exist and cannot be created.
authorJoey Hess <joeyh@joeyh.name>
Tue, 10 Nov 2015 15:42:06 +0000 (11:42 -0400)
committerJoey Hess <joeyh@joeyh.name>
Tue, 10 Nov 2015 15:42:06 +0000 (11:42 -0400)
debian/changelog
standalone/linux/skel/runshell
standalone/osx/git-annex.app/Contents/MacOS/runshell

index d45a9d269a677b0a1cb2896a2dc5f480223d93b0..18a85566181cd6e78ce5854a0702aad01a907382 100644 (file)
@@ -16,6 +16,8 @@ git-annex (5.20151102.2) UNRELEASED; urgency=medium
     recover.
   * quvi may output utf-8 encoded data when the conifigured locale doesn't
     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
 
index b540c983b51eb38eafeb20ce9af4c5af0069e2f2..68a462266bede13f474988172db31e6c3f2eb385 100755 (executable)
@@ -64,12 +64,14 @@ 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
-       (
-               echo "#!/bin/sh"
-               echo "set -e"
-               echo "exec '$base/runshell' \"\$@\""
-       ) > "$HOME/.ssh/git-annex-wrapper"
-       chmod +x "$HOME/.ssh/git-annex-wrapper"
+       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
 
 # Put our binaries first, to avoid issues with out of date or incompatable
index 0af0a0c6f3c306d0014c4603a8523cc884539ad2..b48017f432e5da87c167521841ef6b6bc734d3c5 100755 (executable)
@@ -50,12 +50,14 @@ 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
-       (
-               echo "#!/bin/sh"
-               echo "set -e"
-               echo "exec '$base/runshell' \"\$@\""
-       ) > "$HOME/.ssh/git-annex-wrapper"
-       chmod +x "$HOME/.ssh/git-annex-wrapper"
+       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
 
 # Put our binaries first, to avoid issues with out of date or incompatable