On Wednesday 19 January 2011 09:46 PM, C. Michael Pilato wrote:
On 01/19/2011 10:52 AM, Arwin Arni wrote:
Hi All,

Authz section names(and paths too) are parsed/loaded in a case insensitive way.

So they need to be compared in a case-insensitive way.

Following functions do authz,

1. libsvn_repos/authz.c:authz_get_path_access()
2. libsvn_repos/authz.c:authz_get_any_access() is called when the "path" is
NULL (for MKACTIVITY, DELETE).

'1' is leaving it to svn_config_enumerate2() to handle case (in)sensitiveness.
'2' is explicitly comparing each config item in a case sensitive way.

My patch is just fixing the '2' to check it in a case insensitive way.

So, just to be clear, now read and write access checks will both compare the
repository name in a case-insensitive way?

That's Correct.
Index: subversion/libsvn_repos/authz.c
===================================================================
--- subversion/libsvn_repos/authz.c     (revision 1060836)
+++ subversion/libsvn_repos/authz.c     (working copy)
@@ -398,7 +398,7 @@

    /* Does the section apply to the query? */
    if (section_name[0] == '/'
-      || strncmp(section_name, b->repos_path,
+      || strncasecmp(section_name, b->repos_path,
                   strlen(b->repos_path)) == 0)

You've goofed up the indentation here.

Again.. extremely sorry.. I guess I'm still not completely accustomed to the indentation conventions.. Here's a patch with the indentation fixed..

Regards,
Arwin Arni
Index: subversion/libsvn_repos/authz.c
===================================================================
--- subversion/libsvn_repos/authz.c     (revision 1060836)
+++ subversion/libsvn_repos/authz.c     (working copy)
@@ -398,8 +398,8 @@
 
   /* Does the section apply to the query? */
   if (section_name[0] == '/'
-      || strncmp(section_name, b->repos_path,
-                 strlen(b->repos_path)) == 0)
+      || strncasecmp(section_name, b->repos_path,
+                     strlen(b->repos_path)) == 0)
     {
       b->allow = b->deny = svn_authz_none;
 
Fix for Issue #3781 repo prefix rules in authz section is checked case 
sensitively for write operations

* subversion/libsvn_repos/authz.c
  (authz_get_any_access_parser_cb): Use strncasecmp() instead of strncmp()

Patch by: kameshj
          Arwin Arni <arwin{_AT_}collab.net>

Reply via email to