summaryrefslogtreecommitdiff
path: root/subversion/mod_authz_svn
diff options
context:
space:
mode:
authorJames McCoy <jamessan@debian.org>2019-11-16 13:05:42 -0500
committerJames McCoy <jamessan@debian.org>2019-11-16 13:05:42 -0500
commitff0dcb36b05eb662b51423774a4502bc04378f69 (patch)
tree0839f9b4a052f41206aebfed0c08b2b832621638 /subversion/mod_authz_svn
parent569b75c031bd32d4ee16874ecdf225adac62514d (diff)
New upstream version 1.13.0
Diffstat (limited to 'subversion/mod_authz_svn')
-rw-r--r--subversion/mod_authz_svn/mod_authz_svn.c52
1 files changed, 46 insertions, 6 deletions
diff --git a/subversion/mod_authz_svn/mod_authz_svn.c b/subversion/mod_authz_svn/mod_authz_svn.c
index 979c89d..6ebd9d6 100644
--- a/subversion/mod_authz_svn/mod_authz_svn.c
+++ b/subversion/mod_authz_svn/mod_authz_svn.c
@@ -327,16 +327,17 @@ log_access_verdict(LOG_ARGS_SIGNATURE,
}
}
-/* Log a message indiciating the ERR encountered during the request R.
+/* Log a message at LOG_LEVEL indiciating the ERR encountered during
+ * the request R.
* LOG_ARGS_SIGNATURE expands as in log_access_verdict() above.
* PREFIX is inserted at the start of the message. The rest of the
* message is generated by combining the message for each error in the
* chain of ERR, excluding for trace errors. ERR will be cleared
* when finished. */
static void
-log_svn_error(LOG_ARGS_SIGNATURE,
- request_rec *r, const char *prefix,
- svn_error_t *err, apr_pool_t *scratch_pool)
+log_svn_message(LOG_ARGS_SIGNATURE, int log_level,
+ request_rec *r, const char *prefix,
+ svn_error_t *err, apr_pool_t *scratch_pool)
{
svn_error_t *err_pos = svn_error_purge_tracing(err);
svn_stringbuf_t *buff = svn_stringbuf_create(prefix, scratch_pool);
@@ -360,7 +361,7 @@ log_svn_error(LOG_ARGS_SIGNATURE,
err_pos = err_pos->child;
}
- ap_log_rerror(LOG_ARGS_CASCADE, APLOG_ERR,
+ ap_log_rerror(LOG_ARGS_CASCADE, log_level,
/* If it is an error code that APR can make sense of, then
show it, otherwise, pass zero to avoid putting "APR does
not understand this error code" in the error log. */
@@ -372,6 +373,40 @@ log_svn_error(LOG_ARGS_SIGNATURE,
svn_error_clear(err);
}
+/* Log the error error ERR encountered during the request R.
+ * LOG_ARGS_SIGNATURE expands as in log_access_verdict() above.
+ * PREFIX is inserted at the start of the message. The rest of the
+ * message is generated by combining the message for each error in the
+ * chain of ERR, excluding for trace errors. ERR will be cleared
+ * when finished. */
+static APR_INLINE void
+log_svn_error(LOG_ARGS_SIGNATURE,
+ request_rec *r, const char *prefix,
+ svn_error_t *err, apr_pool_t *scratch_pool)
+{
+ log_svn_message(LOG_ARGS_CASCADE, APLOG_ERR,
+ r, prefix, err, scratch_pool);
+}
+
+/* Baton for log_authz_warning. */
+typedef struct authz_warning_baton_t
+{
+ request_rec *r;
+ const char *prefix;
+} authz_warning_baton_t;
+
+/* Handle an authz parser warning. ERR will *not* be cleared.*/
+static APR_INLINE void
+log_authz_warning(void *baton,
+ const svn_error_t *err,
+ apr_pool_t *scratch_pool)
+{
+ const authz_warning_baton_t *const warning_baton = baton;
+ log_svn_message(APLOG_MARK, APLOG_WARNING,
+ warning_baton->r, warning_baton->prefix,
+ svn_error_dup(err), scratch_pool);
+}
+
/* Resolve *PATH into an absolute canonical URL iff *PATH is a repos-relative
* URL. If *REPOS_URL is NULL convert REPOS_PATH into a file URL stored
* in *REPOS_URL, if *REPOS_URL is not null REPOS_PATH is ignored. The
@@ -472,8 +507,13 @@ get_access_conf(request_rec *r, authz_svn_config_rec *conf,
access_conf = user_data;
if (access_conf == NULL)
{
- svn_err = svn_repos_authz_read3(&access_conf, access_file,
+ authz_warning_baton_t warning_baton;
+ warning_baton.r = r;
+ warning_baton.prefix = "mod_authz_svn: warning:";
+
+ svn_err = svn_repos_authz_read4(&access_conf, access_file,
groups_file, TRUE, NULL,
+ log_authz_warning, &warning_baton,
r->connection->pool,
scratch_pool);