Author: danielsh
Date: Wed Jul  4 11:57:53 2018
New Revision: 1835049

URL: http://svn.apache.org/viewvc?rev=1835049&view=rev
Log:
* subversion/tests/libsvn_repos/authz-test.c
  (reposful_reposless_stanzas_inherit): New regression test.

I've manually verified that `svnauthz accessof --repository project1 --path
/foo --username user1 --recursive authz` outputs 'rw' in 1.9 and 'no' in trunk.

Reported by: Michael Ruder
Thread: 
https://mail-archives.apache.org/mod_mbox/subversion-users/201807.mbox/%3Calpine.WNT.2.20.1807041318540.19228%40MICHAEL-NB.tau-tec.tu%3E

Modified:
    subversion/trunk/subversion/tests/libsvn_repos/authz-test.c

Modified: subversion/trunk/subversion/tests/libsvn_repos/authz-test.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_repos/authz-test.c?rev=1835049&r1=1835048&r2=1835049&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_repos/authz-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_repos/authz-test.c Wed Jul  4 
11:57:53 2018
@@ -478,6 +478,39 @@ issue_4741_groups(apr_pool_t *pool)
    return SVN_NO_ERROR;
 }
 
+static svn_error_t *
+reposful_reposless_stanzas_inherit(apr_pool_t *pool)
+{
+  const char rules[] = 
+    "[groups]"                               NL
+    "company = user1, user2, user3"          NL
+    "customer = customer1, customer2"        NL
+    ""                                       NL
+    "# company can read-write on everything" NL
+    "[/]"                                    NL
+    "@company = rw"                          NL
+    ""                                       NL
+    "[project1:/]"                           NL
+    "@customer = r"                          NL
+    ""                                       NL
+    "[project2:/]"                           NL;
+
+   svn_stringbuf_t *buf = svn_stringbuf_create(rules, pool);
+   svn_stream_t *stream = svn_stream_from_stringbuf(buf, pool);
+   svn_authz_t *authz;
+   svn_boolean_t access_granted;
+
+   SVN_ERR(svn_repos_authz_parse(&authz, stream, NULL, pool));
+
+   SVN_ERR(svn_repos_authz_check_access(authz, "project1", "/foo", "user1",
+                                        svn_authz_write | svn_authz_recursive,
+                                        &access_granted,
+                                        pool));
+   SVN_TEST_ASSERT(access_granted == TRUE);
+
+   return SVN_NO_ERROR;
+}
+
 static int max_threads = 4;
 
 static struct svn_test_descriptor_t test_funcs[] =
@@ -489,6 +522,8 @@ static struct svn_test_descriptor_t test
                    "test svn_authz__get_global_rights"),
     SVN_TEST_PASS2(issue_4741_groups,
                    "issue 4741 groups"),
+    SVN_TEST_XFAIL2(reposful_reposless_stanzas_inherit,
+                    "[foo:/] inherits [/]"),
     SVN_TEST_NULL
   };
 


Reply via email to