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

[PATCH] Allow anonymous ra_svn write access

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2005-11-01 21:41:50 CET

Philip Martin <philip@codematters.co.uk> writes:

> With 1.2 I could enable anonymous write access over ra_svn by doing:
>
> $ svnserve -dr.
> $ svnadmin create repo
> $ echo [general] >> repo/conf/svnserve.conf
> $ echo anon-access = write >> repo/conf/svnserve.conf
>
> With trunk that no longer works, commits now give me
>
> $ svn mkdir -m "" svn://localhost/repo/foo
> ../svn/subversion/svnserve/serve.c:434: (apr_err=170001)
> svn: Authorization failed
>
> I think this is caused by the new svnserve authz stuff, but I haven't
> investigated fully. Is this a known change in behaviour or am I
> making a mistake?

It looks like it's a result of the way the authz stuff handles lock
tokens. I'm don't know much about this bit of code, does the
following look sensible?

Fix a bug that caused anonymous write access over ra_svn to fail
with "Authorization failed" errors.

* subversion/svnserve/serve.c
  (commit): Don't require a username if there are no lock tokens.

Index: subversion/svnserve/serve.c
===================================================================
--- subversion/svnserve/serve.c (revision 17136)
+++ subversion/svnserve/serve.c (working copy)
@@ -922,11 +922,12 @@
      adding tokens (if we have any), and subsequently fail if a lock
      violates authz. */
   SVN_ERR(must_have_access(conn, pool, b, svn_authz_write,
- NULL, lock_tokens ? TRUE : FALSE));
+ NULL,
+ (lock_tokens && lock_tokens->nelts) ? TRUE : FALSE));
 
   /* Authorize the lock tokens and give them to the FS if we got
      any. */
- if (lock_tokens)
+ if (lock_tokens && lock_tokens->nelts)
     SVN_CMD_ERR(add_lock_tokens(conn, lock_tokens, b, pool));
 
   ccb.pool = pool;
@@ -955,7 +956,7 @@
         SVN_ERR(svn_fs_deltify_revision(b->fs, new_rev, pool));
 
       /* Unlock the paths. */
- if (! keep_locks && lock_tokens)
+ if (! keep_locks && lock_tokens && lock_tokens->nelts)
         SVN_ERR(unlock_paths(lock_tokens, b, pool));
 
       SVN_ERR(svn_ra_svn_write_tuple(conn, pool, "r(?c)(?c)",

-- 
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Nov 1 21:44:59 2005

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