File: ssh-no-controlmaster

package info (click to toggle)
subversion 1.14.5-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 80,416 kB
  • sloc: ansic: 1,039,361; python: 140,229; cpp: 24,862; java: 24,547; ruby: 12,312; lisp: 7,619; sh: 7,414; perl: 7,010; sql: 1,686; makefile: 1,191; xml: 577
file content (51 lines) | stat: -rw-r--r-- 2,395 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
From: James McCoy <jamessan@debian.org>
Date: Wed, 1 Aug 2018 20:44:36 -0400
Subject: ssh-no-controlmaster

Bug #413102: Avoid accidentally becoming an ssh ControlMaster.
Bug #413102: Avoid accidentally becoming an ssh ControlMaster.

If you set ControlMaster via your ssh config:
.ssh/config:
Host *
    ControlMaster auto
    Controlpath ~/.ssh/master-%r@%h:%p

you can get 'svn: Can't write to connection: Broken pipe' with certain
ssh commands, because svn can open multiple ssh sessions and kill them
at unpredictable times.

I don't really think the problem is either svn's or openssh's fault,
but this is the obvious way to avoid it.  We will still use ssh
connection sharing, but only if a ControlMaster is already present.
---
 subversion/libsvn_ra_svn/client.c    | 2 +-
 subversion/libsvn_subr/config_file.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/subversion/libsvn_ra_svn/client.c b/subversion/libsvn_ra_svn/client.c
index f484519..c6e3d77 100644
--- a/subversion/libsvn_ra_svn/client.c
+++ b/subversion/libsvn_ra_svn/client.c
@@ -399,7 +399,7 @@ static svn_error_t *find_tunnel_agent(const char *tunnel,
        * versions have it too. If the user is using some other ssh
        * implementation that doesn't accept it, they can override it
        * in the [tunnels] section of the config. */
-      val = "$SVN_SSH ssh -q --";
+      val = "$SVN_SSH ssh -q -o ControlMaster=no --";
     }
 
   if (!val || !*val)
diff --git a/subversion/libsvn_subr/config_file.c b/subversion/libsvn_subr/config_file.c
index a437c89..1ae583f 100644
--- a/subversion/libsvn_subr/config_file.c
+++ b/subversion/libsvn_subr/config_file.c
@@ -1448,7 +1448,7 @@ svn_config_ensure(const char *config_dir, apr_pool_t *pool)
         "### <hostinfo> argument in the usual way: <user>@<hostname>:<port>."NL
         "### If the built-in ssh scheme were not predefined, it could be"    NL
         "### defined as:"                                                    NL
-        "# ssh = $SVN_SSH ssh -q --"                                         NL
+        "# ssh = $SVN_SSH ssh -q -o ControlMaster=no --"                     NL
         "### If you wanted to define a new 'rsh' scheme, to be used with"    NL
         "### 'svn+rsh:' URLs, you could do so as follows:"                   NL
         "# rsh = rsh --"                                                     NL