[MERGE][bug #203186] Ignore passwords for ssh in authentication.conf and warn user

John Arbash Meinel john at arbash-meinel.com
Fri May 16 00:00:59 BST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Vincent Ladeuil wrote:


~         if credentials is not None:
~             password = credentials['password']
+            if scheme is 'ssh':
+                trace.warning('password ignored in section [%s],'
+                              ' use an ssh agent instead'
+                              % credentials['name'])
+                password = None
~         else:
~             password = None
~         # Prompt user only if we could't find a password
~         if password is None:
~             if prompt is None:
- -                # Create a default prompt suitable for most of the cases
+                # Create a default prompt suitable for most cases
~                 prompt = '%s' % scheme.upper() + ' %(user)s@%(host)s password'
~             # Special handling for optional fields in the prompt
~             if port is not None:

^- Doesn't that 'if' check need to be:

if password is not None and scheme is 'ssh':


You should add a test that we *don't* issue a warning if there is a user but no
password.

We also could use symbol_versioning.warn() which already has some code to trap
it rather than trying to use the TestUIFactory. TestUI is ok, though.

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkgswKsACgkQJdeBCYSNAAP2YwCgzTLN2ggATkQOpS67iMhqxPUf
8ScAn2GQOEr/tCUmWCInO4zIm8hx4FMi
=hMCu
-----END PGP SIGNATURE-----



More information about the bazaar mailing list