Checkout
Branko ─îibej
committed
on 25 Apr 13
Fix issue #4361 (user/group names in authz files are case-insensitive).

Because of the way the original svn_config structure was designed t… Show more
Fix issue #4361 (user/group names in authz files are case-insensitive).

Because of the way the original svn_config structure was designed to be

case-preserving but case-insensitive, when using it to parse authz

and group definition files, we had the following problems:

  * User- and group names that differed only in case could not be

    represented in the authorization configuration.

  * The results returned from authorization queries depended,

    although predictably, on the order in which the authz entries

    appeared in the authz file.

In 1.7.0, we added an option to svn_config to make configuration groups

(hence, repository paths in the authz config) case-sensitive. This change

does the same for option names, which map to group and user names.

* subversion/include/svn_config.h

 (svn_config_create2): New, revised from svn_config_create, with additional

  flag to treat option names as case-sensitive.

 (svn_config_read3): New, revised from svn_config_read2, with same

  additional flag as above.

 (svn_config_parse): Add flag to treat option names as case-sensitive.

 (svn_config_create): Deprecated.

 (svn_config_read2): Deprecated; argument "pool" renamde to "result_pool".

 (svn_config_read): Argument "pool" renamde to "result_pool".

* subversion/libsvn_subr/config_impl.h (struct svn_config_t): Add new

  struct member option_names_case_sensitive.

* subversion/libsvn_subr/config.c: Replace the newly deprecated

  svn_config APIs with their revised versions.

 (svn_config_create2): Renamed from

  svn_config_create and implementation updated to the new spec.

 (svn_config_read3): Renamed from svn_config_read; then same as above.

 (svn_config_merge): Make sure both sides of the merged config

  have the same case-(in)sensitive behaviour.

 (svn_config_create_option): Added case-sensitive flag.

* subversion/libsvn_subr/deprecated.c

 (svn_config_create, svn_config_read2): Implement deprecated wrappers.

* subversion/libsvn_repos/authz.c

 (authz_retrieve_config_repo, authz_retrieve_config,

 svn_repos__authz_read, svn_repos_authz_parse): Parse authz and groups config

  files with case-sensitive user and group names.

* subversion/libsvn_repos/hooks.c (svn_repos__parse_hooks_env):

  Likewise for the hooks environment file.

* subversion/libsvn_fs_fs/fs_fs.c,

 subversion/svnserve/serve.c,

 subversion/svnserve/svnserve.c,

 subversion/tests/libsvn_subr/cache-test.c,

 tools/server-side/mod_dontdothat/mod_dontdothat.c: Replace the newly

  deprecated svn_config APIs with their revised versions.

  No functional changes were made.

Show less