_get_vendor_by_inspection incorrectly determines "plink" to be the executable

Bug #107155 reported by Andrew Bennetts
4
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Medium
Martin Albisetti

Bug Description

A windows user on #bzr reported that they were getting "WindowsError: [Errno 2] The system cannot find the file specified" when trying to do SFTP with bzr 0.15.

It turns out that on their system, the command "ssh -V" reports "plink: Release 0.58". Our SSH vendor code incorrectly assumes that if the version string has "plink" in it, then the executable must be "plink", even if the version string was found by running a different command.

Here's their bzr.log file:

"""
looking for plugins in C:/Documents and Settings/Chris/Application Data/bazaar/2.0/plugins
looking for plugins in D:\Web\Python24\lib\site-packages\bzrlib\plugins
Plugin name __init__ already loaded
Plugin name __init__ already loaded
encoding stdout as sys.stdout encoding 'cp437'
WARNING: using slower ElementTree; consider installing cElementTree and make sure it's on your PYTHONPATH
got branch format Bazaar-NG branch format 5
ssh implementation is Putty's plink.
Traceback (most recent call last):
  File "D:\Web\Python24\Lib\site-packages\bzrlib\commands.py", line 650, in run_bzr_catch_errors
    return run_bzr(argv)
  File "D:\Web\Python24\Lib\site-packages\bzrlib\commands.py", line 612, in run_bzr
    ret = run(*run_argv)
  File "D:\Web\Python24\Lib\site-packages\bzrlib\commands.py", line 304, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "D:\Web\Python24\Lib\site-packages\bzrlib\builtins.py", line 694, in run
    to_transport = transport.get_transport(location)
  File "D:\Web\Python24\Lib\site-packages\bzrlib\transport\__init__.py", line 1039, in get_transport
    t, last_err = _try_transport_factories(base, factory_list)
  File "D:\Web\Python24\Lib\site-packages\bzrlib\transport\__init__.py", line 1097, in _try_transport_factories
    return factory(base), None
  File "D:\Web\Python24\Lib\site-packages\bzrlib\transport\__init__.py", line 109, in _loader
    return klass(base)
  File "D:\Web\Python24\Lib\site-packages\bzrlib\transport\sftp.py", line 223, in __init__
    self._sftp_connect()
  File "D:\Web\Python24\Lib\site-packages\bzrlib\transport\sftp.py", line 834, in _sftp_connect
    self._password)
  File "D:\Web\Python24\Lib\site-packages\bzrlib\transport\sftp.py", line 1198, in _sftp_connect
    sftp = _sftp_connect_uncached(host, port, username, password)
  File "D:\Web\Python24\Lib\site-packages\bzrlib\transport\sftp.py", line 1204, in _sftp_connect_uncached
    sftp = vendor.connect_sftp(username, password, host, port)
  File "D:\Web\Python24\Lib\site-packages\bzrlib\transport\ssh.py", line 342, in connect_sftp
    sock = self._connect(argv)
  File "D:\Web\Python24\Lib\site-packages\bzrlib\transport\ssh.py", line 334, in _connect
    stdout=subprocess.PIPE,
  File "D:\Web\Python24\lib\subprocess.py", line 542, in __init__
    errread, errwrite)
  File "D:\Web\Python24\lib\subprocess.py", line 706, in _execute_child
    startupinfo)
WindowsError: [Errno 2] The system cannot find the file specified

return code 3
"""

As a workaround, the user can set BZR_SSH=paramiko in their environment to disable the buggy guessing.

See also bug 107146.

Tags: win32
Martin Pool (mbp)
Changed in bzr:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Martin Albisetti (beuno) wrote :
Revision history for this message
Martin Albisetti (beuno) wrote :

Patch approved and entered bzr.dev

Changed in bzr:
assignee: nobody → beuno
status: Confirmed → Fix Committed
Revision history for this message
Alexander Belchenko (bialix) wrote :

when patch merged we usually mark bug report as Fix Released.

Changed in bzr:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.