You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Garrett Rooney <ro...@electricjellyfish.net> on 2003/09/14 19:03:06 UTC

[PATCH] optionally allow username to be passed with svnserve ANONYMOUS auth

As Greg Hudson suggested yesterday, a better way to get what I wanted 
(usernames in my svnserve commits) would be to just pass it down as the 
argument for the ANONYMOUS authentication mechanism.  There is a new 
command line argument (-u) for svnserve to optionally allow it to accept 
these usenames and use them wherever they are required.

Any comments?

-garrett

Re: [PATCH] optionally allow username to be passed with svnserve ANONYMOUS auth

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
Chia-liang Kao wrote:
> Hi,
> 
> I'm having a problem with SVN::Mirror over ra_svn after this patch. it
> fails to get the first credential at all, since svn:mirror doesn't
> supply default username, nor does the connection have a stored
> credential.
> 
> so the line:
>     user = ((svn_auth_cred_username_t *) creds)->username;
> 
> causes a segfault.
> 
> would you kindly test creds before dereferencing it?

Sure thing.  I'll add a check for that case later today.

-garrett


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] optionally allow username to be passed with svnserve ANONYMOUS auth

Posted by Chia-liang Kao <cl...@clkao.org>.
Hi,

I'm having a problem with SVN::Mirror over ra_svn after this patch. it
fails to get the first credential at all, since svn:mirror doesn't
supply default username, nor does the connection have a stored
credential.

so the line:
    user = ((svn_auth_cred_username_t *) creds)->username;

causes a segfault.

would you kindly test creds before dereferencing it?

Cheers,
CLK

On Sun, 2003-09-14 at 21:03, Garrett Rooney wrote:
> As Greg Hudson suggested yesterday, a better way to get what I wanted 
> (usernames in my svnserve commits) would be to just pass it down as the 
> argument for the ANONYMOUS authentication mechanism.  There is a new 
> command line argument (-u) for svnserve to optionally allow it to accept 
> these usenames and use them wherever they are required.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] optionally allow username to be passed with svnserve ANONYMOUS auth

Posted by Greg Hudson <gh...@MIT.EDU>.
On Sun, 2003-09-14 at 21:06, Garrett Rooney wrote:
> Greg Hudson wrote:
> > (Now that I'm thinking about this, I think if mecharg is NULL, we should
> > issue a challenge for a token, rather than behave as if the mecharg were
> > the empty string.  But there's no need to worry about that just now.)
> 
> I assume you mean only in the case where the server is running with -u, 
> right?

No, all the time.  The ANONYMOUS mechanism includes one token sent from
the client to the server (possibly the empty string); if the client
doesn't send that token as a mechanism argument, then the mechanism has
not completed and, per RFC 2222 section 5.1, the server should issue a
challenge with no data.

>   Otherwise we'd have a backwards compatability problem.

No backwards compatibility problem; the client always sends a mechanism
argument (possibly the empty string).  And if someone were to write
their own client implementation for some reason, they should also use
the mechanism argument.  So this is a very theoretical issue; thus the
"no need to worry about that just now."


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] optionally allow username to be passed with svnserve ANONYMOUS auth

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
Greg Hudson wrote:

> On Sun, 2003-09-14 at 15:03, Garrett Rooney wrote:
> 
>>Any comments?
> 
> 
> I have one correctness comment and some style nits:

Thanks, I've fixed these issues and I'll commit the change shortly.

> (Now that I'm thinking about this, I think if mecharg is NULL, we should
> issue a challenge for a token, rather than behave as if the mecharg were
> the empty string.  But there's no need to worry about that just now.)

I assume you mean only in the case where the server is running with -u, 
right?  Otherwise we'd have a backwards compatability problem.  Anyway, 
that sounds reasonable to me, but if we're going to do it, it would be 
nice to do it sooner rather than later, so there is no backwards 
compatability issue at all.

-garrett


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] optionally allow username to be passed with svnserve ANONYMOUS auth

Posted by Greg Hudson <gh...@MIT.EDU>.
On Sun, 2003-09-14 at 15:03, Garrett Rooney wrote:
> Any comments?

I have one correctness comment and some style nits:

> +      if (!user)
> +        {
> +          svn_auth_iterstate_t *iterstate;

ra_svn code prefers to group all variable declarations at the beginning
of functions.

>        SVN_ERR(svn_ra_svn_write_tuple(conn, pool, "nw(c)()", (apr_uint64_t) 1,
> -                                     "ANONYMOUS", ""));
> +                                     "ANONYMOUS", user));

If user is NULL, this will dump core.  Send "" if user is NULL (since
ANONYMOUS demands a mechanism argument).

> +      if (believe_username && mecharg && mecharg[0])
> +        {
> +          user = mecharg;
> +        }

ra_svn code prefers not to put braces around single-statement if
bodies.  It also prefers to use *mecharg instead of mecharg[0] to test
for the non-emptiness of a string.

(Now that I'm thinking about this, I think if mecharg is NULL, we should
issue a challenge for a token, rather than behave as if the mecharg were
the empty string.  But there's no need to worry about that just now.)


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org