Author: stefan2
Date: Tue Nov 15 19:35:39 2016
New Revision: 1769871
URL: http://svn.apache.org/viewvc?rev=1769871&view=rev
Log:
On the authzperf branch: More header cleanup.
* subversion/libsvn_repos/authz.h
(svn_repos__authz_read): Remove as no longer needed outside authz.c .
* subversion/libsvn_repos/authz.c
(svn_repos__authz_read): Rename to ...
(authz_read): ... this and drop the ACCEPT_URLS parameter that would
always be true by now. Simplify the implementation.
(svn_repos_authz_read2): Update the only caller.
Modified:
subversion/branches/authzperf/subversion/libsvn_repos/authz.c
subversion/branches/authzperf/subversion/libsvn_repos/authz.h
Modified: subversion/branches/authzperf/subversion/libsvn_repos/authz.c
URL:
http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_repos/authz.c?rev=1769871&r1=1769870&r2=1769871&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_repos/authz.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_repos/authz.c Tue Nov 15
19:35:39 2016
@@ -1538,38 +1538,37 @@ svn_repos__retrieve_config(svn_config_t
return SVN_NO_ERROR;
}
+/* Read authz configuration data from PATH into *AUTHZ_P, allocated in
+ RESULT_POOL. If GROUPS_PATH is set, use the global groups parsed from it.
+ Use SCRATCH_POOL for temporary allocations.
+
+ PATH and GROUPS_PATH may be a dirent, a registry path or an absolute file
+ url.
+
+ If PATH or GROUPS_PATH is not a valid authz rule file, then return
+ SVN_AUTHZ_INVALID_CONFIG. The contents of *AUTHZ_P is then
+ undefined. If MUST_EXIST is TRUE, a missing authz or global groups file
+ is also an error. */
svn_error_t *
-svn_repos__authz_read(svn_authz_t **authz_p, const char *path,
- const char *groups_path, svn_boolean_t must_exist,
- svn_boolean_t accept_urls, apr_pool_t *result_pool,
- apr_pool_t *scratch_pool)
+authz_read(svn_authz_t **authz_p,
+ const char *path,
+ const char *groups_path,
+ svn_boolean_t must_exist,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
svn_stream_t *rules;
- svn_stream_t *groups;
+ svn_stream_t *groups = NULL;
svn_error_t* err;
/* Open the main authz file */
- if (accept_urls)
- SVN_ERR(retrieve_config(&rules, path, must_exist, scratch_pool,
- scratch_pool));
- else
- SVN_ERR(authz_retrieve_config_file(&rules, path, must_exist,
- scratch_pool, scratch_pool));
+ SVN_ERR(retrieve_config(&rules, path, must_exist, scratch_pool,
+ scratch_pool));
/* Open the optional groups file */
if (groups_path)
- {
- if (accept_urls)
- SVN_ERR(retrieve_config(&groups, groups_path, must_exist,
- scratch_pool, scratch_pool));
- else
- SVN_ERR(authz_retrieve_config_file(&groups, groups_path, must_exist,
- scratch_pool, scratch_pool));
- }
- else
- {
- groups = NULL;
- }
+ SVN_ERR(retrieve_config(&groups, groups_path, must_exist,
+ scratch_pool, scratch_pool));
/* Parse the configuration(s) and construct the full authz model from it. */
err = svn_authz__parse(authz_p, rules, groups, result_pool,
@@ -1596,8 +1595,8 @@ svn_repos_authz_read2(svn_authz_t **auth
{
apr_pool_t *scratch_pool = svn_pool_create(pool);
- SVN_ERR(svn_repos__authz_read(authz_p, path, groups_path, must_exist,
- TRUE, pool, scratch_pool));
+ SVN_ERR(authz_read(authz_p, path, groups_path, must_exist, pool,
+ scratch_pool));
svn_pool_destroy(scratch_pool);
return SVN_NO_ERROR;
Modified: subversion/branches/authzperf/subversion/libsvn_repos/authz.h
URL:
http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_repos/authz.h?rev=1769871&r1=1769870&r2=1769871&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_repos/authz.h (original)
+++ subversion/branches/authzperf/subversion/libsvn_repos/authz.h Tue Nov 15
19:35:39 2016
@@ -299,26 +299,6 @@ svn_authz__parse(svn_authz_t **authz,
apr_pool_t *scratch_pool);
-/* Read authz configuration data from PATH into *AUTHZ_P, allocated in
- RESULT_POOL. If GROUPS_PATH is set, use the global groups parsed from it.
- Use SCRATCH_POOL for temporary allocations.
-
- PATH and GROUPS_PATH may be a dirent or a registry path and iff ACCEPT_URLS
- is set it may also be an absolute file url.
-
- If PATH or GROUPS_PATH is not a valid authz rule file, then return
- SVN_AUTHZ_INVALID_CONFIG. The contents of *AUTHZ_P is then
- undefined. If MUST_EXIST is TRUE, a missing authz or global groups file
- is also an error. */
-svn_error_t *
-svn_repos__authz_read(svn_authz_t **authz_p,
- const char *path,
- const char *groups_path,
- svn_boolean_t must_exist,
- svn_boolean_t accept_urls,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool);
-
/* Reverse a STRING of length LEN in place. */
void
svn_authz__reverse_string(char *string, apr_size_t len);