[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] Username caching

From: Daniel Shahaf <d.s_at_daniel.shahaf.co.il>
Date: Tue, 22 Apr 2008 23:03:22 +0300 (IDT)

[ CCing Stefan as he pointed out (2) and worked with this code recently. ]

Karl Fogel wrote on Tue, 22 Apr 2008 at 14:20 -0400:
> Daniel Shahaf <d.s_at_daniel.shahaf.co.il> writes:
> > 1. If 'store-passwords' (in ~/.subversion/config) was set to FALSE,
> > then usernames would not be cached either.
> >
> > 2. simple_save_creds_helper only checked CREDS->may_save, but
> > ignored its SVN_AUTH_PARAM_NO_AUTH_CACHE parameter.
> > (stsp pointed this out)
>
> What was the user-visible manifestation of (2) ?
>

[ Summary: API violation, cmdline client probably unaffected. ]

The documentation of SVN_AUTH_PARAM_NO_AUTH_CACHE requires:

        /** @brief The application doesn't want any providers to save credentials
         * to disk. Property value is irrelevant; only property's existence
         * matters. */
        #define SVN_AUTH_PARAM_NO_AUTH_CACHE SVN_AUTH_PARAM_PREFIX "no-auth-cache"

However, the simple provider (simple_first_creds_helper) does not inspect
SVN_AUTH_PARAM_NO_AUTH_CACHE when it sets CREDS->may_save. (It only
inspects the cached 'password type' and the API equivalents of --username
and --password.) This might be considered an API violation.

As to user-visible manifestation, however, I have not succeeded in
reproducing this situation (where may_save is TRUE and
SVN_AUTH_PARAM_NO_AUTH_CACHE is set) with the cmdline client, because
svn_auth_save_credentials checks and does not call the provider if
SVN_AUTH_PARAM_NO_AUTH_CACHE is set:

290 svn_auth_save_credentials(svn_auth_iterstate_t *state,
291 apr_pool_t *pool)
292 {
...
309 /* Do not save the creds if SVN_AUTH_PARAM_NO_AUTH_CACHE is set */
310 no_auth_cache = apr_hash_get(auth_baton->parameters,
311 SVN_AUTH_PARAM_NO_AUTH_CACHE,
312 APR_HASH_KEY_STRING);
313 if (no_auth_cache)
314 return SVN_NO_ERROR;
315
316 /* First, try to save the creds using the provider that produced them. */
317 provider = APR_ARRAY_IDX(state->table->providers,
318 state->provider_idx,
319 svn_auth_provider_object_t *);
320 if (provider->vtable->save_credentials)
321 SVN_ERR(provider->vtable->save_credentials(&save_succeeded,

In other words, by the time the simple provider (simple_save_creds_helper)
is called, it has already been established for it that
SVN_AUTH_PARAM_NO_AUTH_CACHE is not set.

Sorry for not explaining all this originally.

Daniel

> Thanks,
> -Karl
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-04-22 22:03:30 CEST

This is an archived mail posted to the Subversion Dev mailing list.