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

Re: Error in authz file

From: David Glasser <glasser_at_mit.edu>
Date: 2006-11-17 18:22:36 CET

On 11/17/06, Peter Lundblad <plundblad@google.com> wrote:
> A quick look at the code yields that it shold do so. I haven't tried
> it and don't know why it complains about the 's', though. So, if the quoted
> config file is the one that generates the error, then this might be a
> bugt.

I think this patch fixes it. Also fixes an error leak. Have to run
now, and have merely determined that it compiles; somebody else should
sanity-check, run (and write?) tests, and commit.

--dave

[[[
Signal first error in parsing authz values, not last. This both
returns a more useful error,
and doesn't leak a bunch of errors in the middle.

* subversion/libsvn_repos/authz.c
  (authz_validate_rule): Return after creating an error.
]]]

=== subversion/libsvn_repos/authz.c
==================================================================
--- subversion/libsvn_repos/authz.c (revision 108568)
+++ subversion/libsvn_repos/authz.c (local)
@@ -530,10 +530,12 @@

   while (*val)
     {
- if (*val != 'r' && *val != 'w' && ! svn_ctype_isspace(*val))
+ if (*val != 'r' && *val != 'w' && ! svn_ctype_isspace(*val)) {
         b->err = svn_error_createf(SVN_ERR_AUTHZ_INVALID_CONFIG, NULL,
                                    "The character '%c' in rule '%s' is not "
                                    "allowed in authz rules", *val, name);
+ return FALSE;
+ }

       ++val;
     }

-- 
David Glasser | glasser_at_mit.edu | http://www.davidglasser.net/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Nov 17 18:22:54 2006

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.