Rev 2775: Fix detection of ssh implementation on Windows in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Fri Aug 31 09:52:59 BST 2007


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 2775
revision-id: pqm at pqm.ubuntu.com-20070831085255-w43drl9sistvl5dl
parent: pqm at pqm.ubuntu.com-20070831073911-5saibq43v0uvsh7r
parent: mbp at sourcefrog.net-20070831080022-j5nxiezb5uxlche5
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Fri 2007-08-31 09:52:55 +0100
message:
  Fix detection of ssh implementation on Windows
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/transport/ssh.py        ssh.py-20060824042150-0s9787kng6zv1nwq-1
    ------------------------------------------------------------
    revno: 2772.3.2
    merged: mbp at sourcefrog.net-20070831080022-j5nxiezb5uxlche5
    parent: mbp at sourcefrog.net-20070831053810-uibzfoh2s16lt93b
    parent: pqm at pqm.ubuntu.com-20070831062501-zi3hbjphrmz4jv4x
    committer: Martin Pool <mbp at sourcefrog.net>
    branch nick: plink
    timestamp: Fri 2007-08-31 18:00:22 +1000
    message:
      merge trunk
    ------------------------------------------------------------
    revno: 2772.3.1
    merged: mbp at sourcefrog.net-20070831053810-uibzfoh2s16lt93b
    parent: pqm at pqm.ubuntu.com-20070831020510-emrlta5dk6ta95zp
    parent: argentina at gmail.com-20070830201954-i1cn3pmft81zws9r
    committer: Martin Pool <mbp at sourcefrog.net>
    branch nick: plink
    timestamp: Fri 2007-08-31 15:38:10 +1000
    message:
      Fix detection of ssh implementation on Windows
    ------------------------------------------------------------
    revno: 2767.3.1
    merged: argentina at gmail.com-20070830201954-i1cn3pmft81zws9r
    parent: pqm at pqm.ubuntu.com-20070829161516-le0ppkanxngkjg69
    committer: Martin Albisetti <argentina at gmail.com>
    branch nick: bzr.beuno
    timestamp: Thu 2007-08-30 17:19:54 -0300
    message:
      Fixed bug #107155
=== modified file 'NEWS'
--- a/NEWS	2007-08-31 07:39:11 +0000
+++ b/NEWS	2007-08-31 08:52:55 +0000
@@ -73,6 +73,9 @@
    * bzr send uses default values for ranges when only half of an elipsis
      is specified ("-r..5" or "-r5..").  (#61685, Aaron Bentley)
 
+   * Avoid trouble when Windows ssh calls itself 'plink' but no plink
+     binary is present.  (Martin Albisetti, #107155)
+
   IMPROVEMENTS:
 
    * Add the option "--show-diff" to the commit command in order to display

=== modified file 'bzrlib/transport/ssh.py'
--- a/bzrlib/transport/ssh.py	2007-05-12 19:05:12 +0000
+++ b/bzrlib/transport/ssh.py	2007-08-31 05:38:10 +0000
@@ -114,10 +114,11 @@
             stdout = stderr = ''
         return stdout + stderr
 
-    def _get_vendor_by_version_string(self, version):
+    def _get_vendor_by_version_string(self, version, args):
         """Return the vendor or None based on output from the subprocess.
 
         :param version: The output of 'ssh -V' like command.
+        :param args: Command line that was run.
         """
         vendor = None
         if 'OpenSSH' in version:
@@ -126,7 +127,10 @@
         elif 'SSH Secure Shell' in version:
             mutter('ssh implementation is SSH Corp.')
             vendor = SSHCorpSubprocessVendor()
-        elif 'plink' in version:
+        elif 'plink' in version and args[0] == 'plink':
+            # Checking if "plink" was the executed argument as Windows sometimes 
+            # reports 'ssh -V' incorrectly with 'plink' in it's version. 
+            # See https://bugs.launchpad.net/bzr/+bug/107155
             mutter("ssh implementation is Putty's plink.")
             vendor = PLinkSubprocessVendor()
         return vendor
@@ -135,7 +139,7 @@
         """Return the vendor or None by checking for known SSH implementations."""
         for args in [['ssh', '-V'], ['plink', '-V']]:
             version = self._get_ssh_version_string(args)
-            vendor = self._get_vendor_by_version_string(version)
+            vendor = self._get_vendor_by_version_string(version, args)
             if vendor is not None:
                 return vendor
         return None




More information about the bazaar-commits mailing list