Checkout Tools
  • last updated 1 hour ago
Constraints: committers
Constraints: files
Constraints: dates
Introduce a warning callback to the authz file parser API.

We need this to warn about the use of empty groups in authz files;

this is not an error and doesn't affect the authz file semantics,

but it's nice to be able to tell the user about it.

See issues #4794, #4802 and #4803.

* subversion/include/svn_repos.h

(svn_repos_authz_warning_func_t): New callback function type.

(svn_repos_authz_read4): New; API revision.

(svn_repos_authz_read3): Deprecated.

(svn_repos_authz_parse2): New; API revision.

(svn_repos_authz_parse): Deprecated.

* subversion/libsvn_repos/authz.h

(svn_authz__parse): Add warning function and baton parameters.

* subversion/libsvn_repos/authz.c

(authz_read): Add warning function and baton parameters.

Update calls to svn_authz__parse.

(svn_repos_authz_read4): Revised from svn_repos_authz_read3.

(svn_repos_authz_parse2): Revised from svn_repos_authz_parse.

* subversion/libsvn_repos/authz_parse.c

(struct ctor_baton_t): Add members warning_func and warning_baton.

(create_ctor_baton): Initialise these new members of the constructor baton.

(emit_parser_warning): New.

(SVN_AUTHZ_PARSE_WARN): New; wrapper macro for the above.

(array_insert_ace): Ignore and warn about the use of empty groups.

(svn_authz__parse): Update implementation to match prototype.

* subversion/libsvn_repos/deprecated.c

(svn_repos_authz_read3, svn_repos_authz_parse): Implement deprecated functions.

* subversion/mod_authz_svn/mod_authz_svn.c

(log_svn_message): New; replaces log_svn_error so that it's useful for

logging warnings as well.

(log_svn_error): Reimplement, calling log_svn_message.

(struct authz_warning_baton_t): New.

(log_authz_warning): New.

(get_access_conf): Set up an authz warning handler and baton, and call

svn_repos_authz_read4 instead of svn_repos_authz_read3.

* subversion/svnserve/logger.h

(logger__log_error): Make the 'err' parameter a pointer-to-const.

Update the docstring to say that the error is not cleared.

(logger__log_warning): New.

* subversion/svnserve/logger.c

(log_message): New; common base for logger__log_error and logger__log_message.

Also *do not* allocate 8k on the stack, use the logger pool, which gets

cleared at the end of the function.

(logger__log_error): Reimplement.

(logger__log_warning): Implement.

* subversion/svnserve/serve.c

(log_error): Make the error parameter const. Fix the docstring.

(log_warning): New.

(load_authz_config): Add warning function and baton parameters and fix pool

handling. Now calls svn_repos_authz_read4 instead of svn_repos_authz_read3.

(find_repos): Add warning function and baton parameters for load_authz_config.

(handle_authz_warning): New.

(construct_server_baton): Pass an authz warning handler and baton to find_repos.

* subversion/tests/cmdline/

(group_member_empty_string): Fix docstring.

(empty_group): New test case.

(test_list): Run it.

* subversion/tests/cmdline/

(svnauthz_empty_group_test): Extend the @Issues decorator.

Add a check for the expected warning on stderr.

  1. … 12 more files in changeset.
Provide the same logging detail on stderr in "run once" mode that

we otherwise have in svnserve's log file.

* subversion/svnserve/logger.h

(logger__create_for_stderr): declare new logger constructor

* subversion/svnserve/logger.c

(logger_t): write to streams instead of files

(logger__create_for_stderr): implement new constructor



logger__write): update existing constructor to streams

* subversion/svnserve/svnserve.c

(sub_main): log to stderr when "run once" mode

  1. … 2 more files in changeset.
* trunk/subversion/bindings/javahl/native/GlobalConfig.h

* trunk/subversion/bindings/javahl/native/org_apache_subversion_javahl_util_ConfigLib.cpp

* trunk/subversion/bindings/javahl/native/org_apache_subversion_javahl_util_TunnelChannel.cpp

* trunk/subversion/libsvn_repos/config_pool.c

* trunk/subversion/libsvn_subr/root_pools.c

* trunk/subversion/svnserve/logger.c

* trunk/subversion/svnserve/logger.h

* trunk/subversion/tests/libsvn_subr/root-pools-test.c

* trunk/tools/client-side/svn-bench/null-info-cmd.c

(svn:eol-style): Set to native.

  1. … 8 more files in changeset.
In svnserve, encapsulate the log_file, log_file_mutex pair into a

logger_t data structure and prove an small API for it. Make all

of svnserve use the new, nicer API.

* subversion/svnserve/logger.h

(): new file

(logger_t): declare new data strcuture

(cleanup_logger): new pool cleanup function



logger__write): declare new logger API

* subversion/svnserve/logger.c

(): new file

(logger_t): define new data strcuture



logger__write): implement new logger API

* subversion/svnserve/server.h

(log_error): drop


serve_params_t): use new logger object instead of plain files

* subversion/svnserve/serve.c



log_server_error): drop

(log_error): greatly simplify













serve): update to use the new logger API

* subversion/svnserve/svnserve.c

(serve_socket): use new logger API

(main): ditto; update log init code

  1. … 4 more files in changeset.