Doesn't get user/password details from authentication.conf

Bug #532292 reported by David Coles
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar Subversion Plugin
Fix Released
Medium
Jelmer Vernooij
bzr-svn (Ubuntu)
Fix Released
Undecided
Jelmer Vernooij

Bug Description

Binary package hint: bzr-svn

Trying to checkout a repository with user/password information doesn't work. I have a user and password set in autentication.py, but it still prompts for both:

$ bzr checkout svn+https://<email address hidden>/svn/trunk/ clir-trunk
HTTPS username: coles.david
<https://clir.googlecode.com:443> Google Code Subversion Repository coles.david password:

bazaar log:
Fri 2010-03-05 10:26:09 +1100
0.032 bazaar version: 2.1.0
0.033 bzr arguments: [u'checkout', u'svn+https://<email address hidden>/svn/trunk/', u'clir-trunk']
0.052 looking for plugins in /home/dcoles/.bazaar/plugins
0.053 looking for plugins in /usr/lib/python2.6/dist-packages/bzrlib/plugins
0.116 encoding stdout as sys.stdout encoding 'UTF-8'
0.553 Obtaining username and password for SVN connection '<https://clir.googlecode.com:443> Google Code Subversion Repository'(username: 'dcoles')
0.557 encoding stdout as sys.stdout encoding 'UTF-8'
143.440 encoding stdout as sys.stdout encoding 'UTF-8'

Taking a look at the code in auth.py it appears that get_svn_simple is calling self.get_user and self.get_password and these are what are promping for the username/password. The issue looks like self.host is not being set before these functions get called and so they don't match any entries in my authentication.conf. Hacking the function to hard-code self.host to "clir.googlecode.com" causes these functions to return the expected user and password from authentication.conf.

I've tried this both with and without a username set in the URL - doesn't seem to make much of a difference.

ProblemType: Bug
Architecture: amd64
Date: Fri Mar 5 00:17:46 2010
DistroRelease: Ubuntu 10.04
EcryptfsInUse: Yes
InstallationMedia: Ubuntu 9.10 "Karmic Koala" - Release amd64 (20091027)
Package: bzr-svn 1.0.2-2
PackageArchitecture: all
ProcEnviron:
 PATH=(custom, user)
 LANG=en_AU.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.32-14.20-generic
SourcePackage: bzr-svn
Uname: Linux 2.6.32-14-generic x86_64

Related branches

Revision history for this message
David Coles (dcoles) wrote :
Revision history for this message
David Coles (dcoles) wrote :

Looks like the issue is in create_auth_baton. When it calls `(scheme, netloc, path, _, _) = urlparse.urlsplit(url)`, netloc ends up being '' and path is '//<email address hidden>/svn/trunk/'. The urlparse.urlsplit function doesn't like 'svn+https' being passed to it - in urllib there's a 'uses_netloc' variable which determines if a url should be split into a netloc (which has things like 'http', 'svn', 'svn+https' etc.). So, either need to split the url ourselves or snip off the 'svn+' prefix.

Revision history for this message
David Coles (dcoles) wrote :

Here's a small patch that fixes the problem by copying the code in SubversionAuthenticationConfig.__init__ that strips the 'svn+' from the scheme into create_auth_baton - nothing uses the full scheme anyway.

I've left the duplicated code in SubversionAuthenticationConfig.__init__ since I'm not sure if other things call this function directly and rely on it to strip off the 'svn+' from the scheme. If not, it might be good to remove the code from there.

Changed in bzr-svn (Ubuntu):
status: New → In Progress
David Coles (dcoles)
Changed in bzr-svn:
status: New → In Progress
tags: added: patch
Revision history for this message
Jelmer Vernooij (jelmer) wrote : Re: [Bug 532292] Re: Doesn't get user/password details from authentication.conf

On Fri, 2010-03-05 at 00:01 +0000, David Coles wrote:
> Looks like the issue is in create_auth_baton. When it calls `(scheme,
> netloc, path, _, _) = urlparse.urlsplit(url)`, netloc ends up being ''
> and path is '//<email address hidden>/svn/trunk/'. The
> urlparse.urlsplit function doesn't like 'svn+https' being passed to it -
> in urllib there's a 'uses_netloc' variable which determines if a url
> should be split into a netloc (which has things like 'http', 'svn',
> 'svn+https' etc.). So, either need to split the url ourselves or snip
> off the 'svn+' prefix.

urlparse.urlsplit turned out to not support 'svn+http' or 'svn+https' as
a schema.

  status fixreleased

Jelmer Vernooij (jelmer)
Changed in bzr-svn:
status: In Progress → Fix Released
Jelmer Vernooij (jelmer)
Changed in bzr-svn:
assignee: nobody → Jelmer Vernooij (jelmer)
importance: Undecided → Medium
Jelmer Vernooij (jelmer)
Changed in bzr-svn (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Nigel Babu (nigelbabu) wrote :

Thank you for your patch David. Unsubscribing reviewers since patch already integrated upstream.

tags: added: patch-accepted-upstream
removed: patch
Jelmer Vernooij (jelmer)
Changed in bzr-svn (Ubuntu):
status: Fix Committed → Fix Released
assignee: nobody → Jelmer Vernooij (jelmer)
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.