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

Re: Comments on #2489 patch.

From: Senthil Kumaran S <senthil_at_collab.net>
Date: Tue, 15 Jul 2008 14:56:04 +0530

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

Hi Karl,

Karl Fogel wrote:
> A couple of places in libsvn_subr/cmdline.c have code like this:
>
> if (non_interactive == FALSE)
> {
> /* This provider doesn't prompt the user in order to get creds;
> it prompts the user regarding the caching of creds. */
> svn_auth_get_simple_provider2(&provider,
> svn_cmdline_auth_plaintext_prompt,
> pb, pool);
> }
> else
> {
> svn_auth_get_simple_provider2(&provider, NULL, NULL, pool);
> }
> APR_ARRAY_PUSH(providers, svn_auth_provider_object_t *) = provider;
> svn_auth_get_username_provider(&provider, pool);
> APR_ARRAY_PUSH(providers, svn_auth_provider_object_t *) = provider;
>
> But why do we bother to register a null provider in the non_interactive
> case? Why not just avoid pushing onto the 'providers' array at all, in
> that case?

This is because we use the same "svn_auth_provider_object_t *provider"
variable. For example, let us assume we have compiled with 'kwallet' where the
following code is executed:

<snip>
#ifdef SVN_HAVE_KWALLET
          SVN_ERR(get_auth_simple_provider(&provider, "kwallet", pool));
          if (provider)
            {
              APR_ARRAY_PUSH(providers,
                             svn_auth_provider_object_t *) = provider;
            }
#endif
          continue;
</snip>

Once the above code is executed, we do not invalidate 'provider' variable,
after which we call 'svn_auth_get_simple_provider2' and push the provider into
the array. If there is no 'if...else' condition, then we may push the wrong
provider to the array which is not correct. Hence it is good we register a null
provider instead.

Thank You.
- --
Senthil Kumaran S
http://www.stylesen.org/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFIfG0q9o1G+2zNQDgRAvJiAJ9mxw1XIgyePxdYTYOWxRM8Tb0+LQCfYv12
NIWZ8dZqRSrnQoPZtENXdWE=
=ptf3
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-07-15 11:27:23 CEST

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.