Hi Stefan,
Stefan Sperling wrote:
> If you hard code *cached_answer to TRUE, you are overriding whatever
> answer the user gave you. After all, the user may have said 'no',
> in which case may_save_password is FALSE.
> 
> The else condition at line number 297 you are referring to
> is not triggered based on whether *cached_answer is TRUE
> or FALSE. It's based on whether cached_answer is NULL or not.
> It is NULL if we cannot find an answer in the cache. The value
> of the answer (TRUE or FALSE) does not matter.
I missed the '&' before may_save_password in the following code:
<snip>
                       SVN_ERR((*b->plaintext_prompt_func)(&may_save_password,
                                                           realmstring,
                                                           b->prompt_baton,
                                                           pool));
</snip>
hence, I came to this conclusion. Sorry for the noise :)
> Maybe the check should be rewritten to make this more clear,
> like this:
> 
> Index: subversion/libsvn_subr/simple_providers.c
> ===================================================================
> --- subversion/libsvn_subr/simple_providers.c	(revision 31725)
> +++ subversion/libsvn_subr/simple_providers.c	(working copy)
> @@ -286,7 +286,7 @@ svn_auth__simple_save_creds_helper(svn_boolean_t *
>                    cached_answer = apr_hash_get(b->plaintext_answers,
>                                                 realmstring,
>                                                 APR_HASH_KEY_STRING);
> -                  if (cached_answer)
> +                  if (cached_answer != NULL)
>                      may_save_password = *cached_answer;
>                    else
>                      {
> 
> 
> Do you agree or have I misunderstood you?
Yes I perfectly agree with you. Unfortunately I am unable to reproduce this in 
my box today! Is googlecode.com the only way?
-- 
Senthil Kumaran S
http://www.stylesen.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-06-18 08:40:20 CEST