diff options
Diffstat (limited to 'subversion/tests/libsvn_repos/authz-test.c')
-rw-r--r-- | subversion/tests/libsvn_repos/authz-test.c | 45 |
1 files changed, 40 insertions, 5 deletions
diff --git a/subversion/tests/libsvn_repos/authz-test.c b/subversion/tests/libsvn_repos/authz-test.c index 6ee2448..fecafc8 100644 --- a/subversion/tests/libsvn_repos/authz-test.c +++ b/subversion/tests/libsvn_repos/authz-test.c @@ -212,7 +212,7 @@ test_authz_parse(const svn_test_opts_t *opts, APR_READ, APR_OS_DEFAULT, pool)); groups = svn_stream_from_aprfile2(groups_file, FALSE, pool); - SVN_ERR(svn_authz__parse(&authz, rules, groups, pool, pool)); + SVN_ERR(svn_authz__parse(&authz, rules, groups, NULL, NULL, pool, pool)); printf("Access check for ('%s', '%s')\n", check_user, check_repo); @@ -277,9 +277,9 @@ test_authz_parse(const svn_test_opts_t *opts, printf("[users]\n"); if (authz->has_anon_rights) - print_user_rights(NULL, NULL, 0, &authz->anon_rights, pool); + SVN_ERR(print_user_rights(NULL, NULL, 0, &authz->anon_rights, pool)); if (authz->has_authn_rights) - print_user_rights(NULL, NULL, 0, &authz->authn_rights, pool); + SVN_ERR(print_user_rights(NULL, NULL, 0, &authz->authn_rights, pool)); SVN_ERR(svn_iter_apr_hash(NULL, authz->user_rights, print_user_rights, NULL, pool)); printf("\n\n"); @@ -304,7 +304,7 @@ run_global_rights_tests(const char *contents, svn_stringbuf_t *buffer = svn_stringbuf_create(contents, pool); svn_stream_t *stream = svn_stream_from_stringbuf(buffer, pool); - SVN_ERR(svn_repos_authz_parse(&authz, stream, NULL, pool)); + SVN_ERR(svn_repos_authz_parse2(&authz, stream, NULL, NULL, NULL, pool, pool)); for (; test_cases->repos; ++test_cases) { @@ -463,7 +463,7 @@ issue_4741_groups(apr_pool_t *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_parse2(&authz, stream, NULL, NULL, NULL, pool, pool)); SVN_ERR(svn_repos_authz_check_access(authz, "repo", "/", "userA", svn_authz_write, &access_granted, @@ -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_parse2(&authz, stream, NULL, NULL, NULL, pool, 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_funcs[] = "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 }; |