~/.ssh/config support broken in 1.14 !

Robert Collins robert.collins at canonical.com
Thu Apr 23 23:21:13 BST 2009


I have this in my ~/.ssh/config

host foo
   user bar

When I run

ssh foo, I auth successfully

When I run

bzr push bzr+ssh://foo/<stuff>

It fails.

I've tracked it down to the remote client *forcing a username* to ssh
when none is provided in the URL.

This is bogus!

At a minimum, if none is in the URL, and none is explicitly configured,
user should *remain None*.

inferring it from the users shell account on their local machine is
wrong because:
 * ssh/sftp/other-external-protocols will do that themselves.
 * http and other 'web services' style accounts are unlikely to match
   on username anyway - and supplying a username when it hasn't been
   asked for is a privacy leak.

=== modified file 'bzrlib/transport/remote.py'
--- bzrlib/transport/remote.py  2009-03-24 01:53:42 +0000
+++ bzrlib/transport/remote.py  2009-04-23 22:16:47 +0000
@@ -511,9 +511,6 @@
         location_config = config.LocationConfig(self.base)
         bzr_remote_path = location_config.get_bzr_remote_path()
         user = self._user
+        if user is None:
+            auth = config.AuthenticationConfig()
+            user = auth.get_user('ssh', self._host, self._port)
         client_medium = medium.SmartSSHClientMedium(self._host,
self._port,
             user, self._password, self.base,
             bzr_remote_path=bzr_remote_path)




-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20090424/d2858337/attachment-0001.pgp 


More information about the bazaar mailing list