Senthil Kumaran S wrote on Thu, 26 Jun 2008 at 11:48 +0530:
> Daniel Shahaf wrote:
> > > Can STR be NULL here? I prefer
> > >
> > > str = apr_hash_get(creds, SVN_AUTH__AUTHFILE_USERNAME_KEY,
> > > APR_HASH_KEY_STRING);
> > > if (str && strcmp(str->data, username) == 0)
> >
> > Actually, the docstring for svn_auth__password_get_t says:
> >
> > It might be obtained directly from CREDS, or from an external store,
> > using REALMSTRING and USERNAME as keys.
> > So don't we need compare the realms as well?
>
> We need not compare the realms here. If you look at the structure of the files
> which we store into the auth area, inside svn.simple we create one file per
> realm, where the filename is an hashed value of the realm. When we query for a
> password for a particular realm, we get the creds_hash as follows:
>
> <snip>
> err = svn_config_read_auth_data(&creds_hash, SVN_AUTH_CRED_SIMPLE,
> realmstring, config_dir, pool);
> </snip>
>
> So we need not take the realm into account here.
>
Right, all calls to simple_password_get go through
svn_auth__simple_first_creds_helper, which checks the realm for us. So we
don't need to check it here ourselves.
It doesn't make the code easier to follow, but it works.
---------------------------------------------------------------------
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-26 10:32:28 CEST