Make .git/annex/ssh.config file work with versions of ssh older than 7.3, which don...
authorJoey Hess <joeyh@joeyh.name>
Mon, 7 Nov 2016 14:32:57 +0000 (10:32 -0400)
committerJoey Hess <joeyh@joeyh.name>
Mon, 7 Nov 2016 14:32:57 +0000 (10:32 -0400)
When used with an older version of ssh, any ServerAliveInterval in
~/.ssh/config will be overridden by .git/annex/ssh.config.

This commit was sponsored by Josh Taylor on Patreon.

Annex/Ssh.hs
CHANGELOG
doc/bugs/git_annex_init_failed_due_to_unsupported_ssh_option.mdwn

index 43c2c13a9264334852b3390efebce78cf52d6bde..4377de4c58ddef9ba19a4d7006eea71e3454b4fe 100644 (file)
@@ -56,8 +56,12 @@ sshOptions (host, port) gc opts = go =<< sshCachingInfo (host, port)
                -- If it did, a more expensive test would be needed.
                liftIO $ unlessM (doesFileExist overideconfigfile) $
                        viaTmp writeFile overideconfigfile $ unlines
+                               -- Make old version of ssh that does
+                               -- not know about Include ignore those
+                               -- entries.
+                               [ "IgnoreUnknown Include"
                                -- ssh expands "~"
-                               [ "Include ~/.ssh/config"
+                               , "Include ~/.ssh/config"
                                -- ssh will silently skip the file
                                -- if it does not exist
                                , "Include /etc/ssh/ssh_config"
index a939435cf424dbfd02704a0b58caef36a5976e8b..56ce655841baa053914d55e3e5f7734c16e2aeac 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -3,6 +3,10 @@ git-annex (6.20161032) UNRELEASED; urgency=medium
   * Restarting a crashing git process could result in filename encoding
     issues when not in a unicode locale, as the restarted processes's
     handles were not read in raw mode.
+  * Make .git/annex/ssh.config file work with versions of ssh older than
+    7.3, which don't support Include. When used with an older version
+    of ssh, any ServerAliveInterval in ~/.ssh/config will be overridden
+    by .git/annex/ssh.config.
 
  -- Joey Hess <id@joeyh.name>  Tue, 01 Nov 2016 14:02:06 -0400
 
index ed497307708c5821e5f96b6ba3138d3202ac60da..eb961030cd9db86c17bddffc7dd47f5004485777 100644 (file)
@@ -49,3 +49,19 @@ I would just like to be sure nothing else is hidden.
 
 
 
+> [[fixed|done]] by adding "IgnoreUnknown Include" 
+> to the top of `.git/annex/ssh_config`. Thus supporting the old ssh
+> version without needing to probe for its version number.
+> 
+> IgnoreUnknown itself was added back in ssh 6.4, in 2013, so
+> using git-annex with such an old ssh will still not work, but
+> such an old ssh probably has security holes anyway. (Debian oldstable has
+> such an old version of ssh, but Debian stable has 6.5.)
+> 
+> I decided not to update existing `.git/annex/ssh_config` 
+> since a) the user may have edited it and b) it would slow down every call
+> git-annex makes to ssh and c) as noted this problem makes git-annex mark
+> remotes as annex-ignore, and the user will need to manually edit
+> .git/config to remove that in order to recover from the problem, so might
+> as well remove `.git/annex/ssh_config` too.
+> --[[Joey]]