Subject: BUG: Inconsistent handling of challenge-on-commit in git-svn

From: Thomas Robinson <[email-masked]>
Date: Fri, 19 Aug 2011 14:29:17 -0700

Additionally reporting the issue here, because git-svn also fails to 
handle this issue gracefully. Worry not; this is something that SVN 
should fix upstream as well.

I've noticed that, when a conflicting user is specified in what should 
be an invalidatable portion of SVN's authentication cache, git-svn will 
fail the same obscure error thrown by the SVN binary:

$ git svn dcommit
Committing to https://rf-ace.googlecode.com/svn/trunk ...
URL access forbidden for unknown reason: access to 
'/svn/!svn/act/b039ca42-f359-41d0-9523-bbbca5266026' forbidden at 
/usr/local/git/libexec/git-core/git-svn line 4472

The difference, of course, is that explicitly passing my credentials via 
--username appears to be silently ignored, such that my workaround 
posited to the SVN team below *doesn't* work in Git SVN.

This, of course, contradicts the information I could find while 
searching for the problem, notably here:
http://groups.google.com/group/google-code-hosting/browse_thread/thread/72b6875507dca1d1

As such, it is possible that the cache challenge is spuriously taking 
precedence over credentials specified by --username, causing an 
irresolvable conflict until a user's SVN cache is cleared. This is, 
needless to say, less than ideal.

My original bug report to the SVN user community follows below. Thank 
you for taking the time to read this.

- Tom Robinson

---
The following is a bug report for triage and review. I've been unable to 
locate an adequate fix or discussion for this issue; however, I have 
found an acceptable workaround.

When built on OSX, SVN versions 1.6.16 (r1073529) and 1.6.17 (r1128011) 
appear to handle authentication challenges on commit in a non-robust manner.

The testing that follows is against a Google Code project that I 
currently maintain code for, which may be found here:
http://code.google.com/p/rf-ace/

Here is a sparse log of a fresh checkout and commit using SVN version 
1.6.16 (r1073529) on OSX. All builds are inclusive of ra-neon:

$ svn checkout https://rf-ace.googlecode.com/svn/trunk/ rf-ace.svn 
--username [email-masked]
... file data ...
Checked out revision 265.

$ cd rf-ace.svn
... make some changes to existing files ...

$ svn commit
... write the log in my default editor ...

"svn-commit.tmp" 35L, 1392C written
svn: Commit failed (details follow):
svn: access to '/svn/!svn/act/c23cbe26-fda3-46d6-a358-d1d20738c4bf' 
forbidden
svn: Your commit message was left in a temporary file:
svn: '/path/to/my/repo/scrubbed/from/this/report/rf-ace.svn/svn-commit.tmp'

This same behavior exhibits in 1.6.17 (r1128011), and when a log message 
is given using -m.

Here is an approximately equivalent session using SVN version 1.6.11 
(r934486) in CentOS 6:

$ svn checkout https://rf-ace.googlecode.com/svn/trunk/ rf-ace 
--username [email-masked]
... file data ...
Checked out revision 265.

$ cd rf-ace
... make some changes to existing files ...

$ svn up
... file data ...
Checked out revision 269.

$ svn commit -m "Irrelevant log message you can find in r270 of rf-ace"
Authentication realm: <https://rf-ace.googlecode.com:443> Google Code 
Subversion Repository
Password for 'trobinso':
[In which I press enter here to fall back to explicit Username 
specification]

Authentication realm: <https://rf-ace.googlecode.com:443> Google Code 
Subversion Repository
Username: [email-masked]
Password for [email-masked]': [My correct password is 
entered here]
Sending        test/argparse_test.hpp
Transmitting file data .
-----------------------------------------------------------------------
ATTENTION!  Your password for authentication realm:

    <https://rf-ace.googlecode.com:443> Google Code Subversion Repository

can only be stored to disk unencrypted!  You are advised to configure
your system so that Subversion can store passwords encrypted, if
possible.  See the documentation for details.

You can avoid future appearances of this warning by setting the value
of the 'store-plaintext-passwords' option to either 'yes' or 'no' in
'/my/home/directory/.subversion/servers'.
-----------------------------------------------------------------------
Store password unencrypted (yes/no)? yes [I know, I know. See my notes 
below.]

Committed revision 270.

Note that on personal dev boxes, authentication information has been 
stored locally in ~/.subversion (which, I note as an aside, is something 
I only do with definedly-insecure passwords like those automatically 
generated by Google Code on machines that are for internal development 
only). This, too, may cause the issue.

My workaround, of course, is obvious. For all versions of SVN, 
specifying the username explicitly (a la "--username 
[email-masked]") immediately follows up with a challenge 
for my password. I have not verified if this resolves future commit 
attempts.

The catalyst for the issue is Google's recent transition of Google Code 
login system to that of Google Accounts. In this case, for conflicting 
users, the issue only exposed itself when we cut back over to our 
original usernames, and I would speculate this occurs if (and only if)
the same username is specified with an alternate password (as mine was).

Thus, we have a compelling case for potentially spurious handling of 
conflicting user credentials, as may well expose themselves in the 
migration of Google Code SVN repositories. In which I would speculate 
that the right approach would be to invalidate the cached copy of the 
user's credentials and re-challenge both the username and the password. 
Ideally, this behavior would be grafted into a configuration value, 
should it not already exist.

As you might expect, searching for this information is nigh-impossible 
for this exact edge condition, and you will probably receive several 
queries of a similar nature as Google continues to transition accounts 
with access to Google Code. Thus my posting of this bug report: assuming 
my hypothesis is correct, it's a case of inconsistent credential 
handling that results in a non-intuitive error message. As above, this 
would be better handled by configurable invalidation of the user's 
cached credentials.

Thus concludes my report. Please copy me on any mail you expect for me 
to see, as I am not a subscriber to this list.

Best regards,
- Tom Robinson