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

Re: [PATCH] mod_dav_svn: Prevent multi-author commits, prevent no-author commits when there is an author

From: Greg Stein <gstein_at_lyra.org>
Date: 2004-03-16 00:30:06 CET

On Mon, Mar 15, 2004 at 12:12:19PM +0100, Sander Striker wrote:
>...
> This patch tries to fix that. It also prevents multi-author commits,
> which we don't support (yet). We haven't put any thought in how to
> display or represent multiple authors. And, the other ra layers don't
> support it.

+1

>...
> +++ subversion/mod_dav_svn/repos.c (working copy)
> @@ -674,6 +674,45 @@
> return NULL;
> }
>
> + /* Set the txn author if not previously set. Protect against multi-author
> + * commits by verifying authenticated user associated with the current
> + * request is the same as the txn author.
> + */
> + if (comb->priv.repos->username)

Note that this allows for an author to be set at some point, and then a
later operation to *not* have a username set. I think this is acceptable.
The problem really comes up only when you have a change in author.

>...
> + request_author = svn_string_create(comb->priv.repos->username, pool);

There isn't a reason to copy the string onto the heap. Just do:

  request_author.data = comb->priv.repos->username;
  request_author.len = strlen(request_author.data);

And then use &request_author where necessary.

>...

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Mar 16 00:27:57 2004

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.