Hi,
when doing several svn_client_ls() on a protected repo the
client asks for username/password every time. I looked at
the sources and found in libsvn_client/auth.c:
if (force_prompt && ab->prompt_callback)
{
char *prompt = apr_psprintf (pool, "username: ");
SVN_ERR (ab->prompt_callback (username, prompt,
FALSE, /* screen echo ok */
ab->prompt_baton, pool));
cb->got_new_auth_info = TRUE;
/* Store a copy of the username in the auth_baton too. */
ab->username = apr_pstrdup (pool, *username);
return SVN_NO_ERROR;
}
else if (ab->username)
{
/* The auth_baton already has the value, probably from argv[]. */
*username = apr_pstrdup (pool, ab->username);
cb->got_new_auth_info = TRUE;
}
I suggest that the "if (ab->username)" gets placed _before_ the
"if (force_prompt && ...)" so that if the first time no username/password
is there then the client prompts the user, but the second time the
username/password from the last prompting is used instead of prompting
again. This won't affect the command line client but other clients could
use that.
(I'm not very familiar with the new authentication API so if my suggestion
breaks anything else then just ignore my mail)
Stefan
Received on Thu Feb 6 19:01:25 2003