Evgeny Kotkov <evgeny.kotkov@visualsvn.com>

Found Patch
r1561427, r1561426, r1561419 r1568953, r1562222, r1560643, r1559777, r1549770, r1549766, r1548706, r1547489, r1547488, r1547486, r1547421, r1546974, r1518169, r1507993, r1500680, r1500074, r1439992, r1438407, r1435252

r1568953 | rhuijben | 2014-02-17 06:14:22 -0600 (Mon, 17 Feb 2014)

Ensure that access to the fsfs transaction list and free transaction
pointer is properly synchronized on Windows.  Before this changeset,
the corresponding txn-list-lock mutex was being enabled/disabled under
the same condition as the mutexes required for the POSIX fcntl file
locking.  This effectively ended up in no synchronization for the
txn-list operations on Windows.

* subversion/libsvn_fs_fs/fs.c
  (fs_serialized_init): Unconditionally enable the TXN_LIST_LOCK mutex
    when using a threaded APR.

Patch by: Evgeny Kotkov <evgeny.kotkov{_AT_}visualsvn.com>
          (tweaked by me. [Tweaks reverted in r1568955])

r1562222 | stefan2 | 2014-01-28 14:39:23 -0600 (Tue, 28 Jan 2014)

Reduce the lifetime of open proto index files when building log-to-phys and
phys-to-log indices in FSX.  These files are only required locally, so there is
no reason not to close them as soon as possible.  This changeset fixes the
ENOTEMPTY error when committing things (purging transactions, actually) to FSX
repositories on Windows and unbreaks every non-trivial --fs-type=fsx test.

* subversion/libsvn_fs_x/index.c
  (svn_fs_x__l2p_index_create, svn_fs_x__p2l_index_create):
    For consistency, open the proto index files in LOCAL_POOL.  Explicitly call
    svn_io_file_close() for these files when they are no longer required.

Patch by: Evgeny Kotkov <evgeny.kotkov{_AT_}visualsvn.com>

r1561427 | stefan2 | 2014-01-25 18:10:42 -0600 (Sat, 25 Jan 2014)

Fix hotcopy code for pre-1.4 FSFS repositories.

* subversion/libsvn_fs_fs/hotcopy.c
  (hotcopy_update_current): Bump the revision number *before* trying
                            to read the new rev(s) from the target repo.
  (hotcopy_body): Prevent multiple, expensive max ID scans.

* subversion/tests/cmdline/svnadmin_tests.py
  (fsfs_hotcopy_old_non_empty): Should pass now.

Found by: Evgeny Kotkov <evgeny.kotkov{_AT_}visualsvn.com>

r1561426 | stefan2 | 2014-01-25 18:00:31 -0600 (Sat, 25 Jan 2014)

Fix a backward compat in FSFS: when writing repositories formats that
don't support rep sharing, we must not store the uniquifiers.

* subversion/libsvn_fs_fs/transaction.c
  (set_uniquifier): Write uniquifiers only when supported.

Found by: Evgeny Kotkov <evgeny.kotkov{_AT_}visualsvn.com>

r1561419 | stefan2 | 2014-01-25 17:00:04 -0600 (Sat, 25 Jan 2014)

Fix a backward compat regression in FSFS introduced with 1.8:
When a non-deltified directory is written, the expanded size
was no longer stored explicitly.  That causes a crash in the
verification code for pre-1.4 repositories.

With this patch, all size information will always be given --
even for properties where it used to be omitted in the past.
We also fixes the recovery code for pre-1.4 format repositories
with faulty 1.8 commits in them.

* subversion/libsvn_fs_fs/transaction.c
  (write_container_rep): Always set the expanded_size.

* subversion/libsvn_fs_fs/recovery.c
  (recover_find_max_ids): If expanded_size should not be given
                          due to faulty 1.8 code, determine it.

* subversion/tests/cmdline/svnadmin_tests.py
  (verify_non_utf8_paths): Update repo content patterns.
  (fsfs_recover_old_non_empty): Should no longer fail.

Found by: Evgeny Kotkov <evgeny.kotkov{_AT_}visualsvn.com>

r1560643 | rhuijben | 2014-01-23 05:30:30 -0600 (Thu, 23 Jan 2014)

Add two tests for 'svnadmin recover/hotcopy' failing with non-empty old FSFS
repositories (--compatible-version=1.3 / 1.2 / 1.1).

* subversion/tests/cmdline/svnadmin_tests.py
  (recover_old): Rename this...
  (recover_old_empty): ...to this. This helps to distinguish between old and
    new tests for similiar cases. Tweak the docstring for consistency.
  (fsfs_recover_old_non_empty): New test for the erroneous 'svnadmin recover'
    behavior. Marked as XFail.
  (fsfs_hotcopy_old_non_empty): New test for the erroneous 'svnadmin hotcopy'
    behavior. Marked as XFail.
  (test_list): Add references to new tests and update reference to the
    renamed test.

Patch by: Evgeny Kotkov <evgeny.kotkov{_AT_}visualsvn.com>

r1559777 | stefan2 | 2014-01-20 10:52:00 -0600 (Mon, 20 Jan 2014)

Reduce the lifetime of open revision files within core FSFS routines.
Whenever these files are only required in the scope of the routine itself,
there is no reason not to close them before exiting that routine.  Moreover,
leaving them open can lead to various problems when attempting to reorganize
the repository structure on Windows (e.g., ENOTEMPTY error when removing
folders during 'svnadmin pack').

This changeset restores the 1.8.x behavior of these routines and unbreaks the
upgrade_new_txns_to_log_addressing / upgrade_old_txns_to_log_addressing tests
(fs-fs-pack-tests) on Windows.

* subversion/libsvn_fs_fs/cached_data.c
  (get_node_revision_body, svn_fs_fs__check_rep):
    Call svn_fs_fs__close_revision_file().

* subversion/libsvn_fs_fs/pack.c
  (append_revision): Call svn_fs_fs__close_revision_file().

* subversion/libsvn_fs_fs/verify.c
  (compare_l2p_to_p2l_index, compare_p2l_to_l2p_index, compare_p2l_to_rev):
    Call svn_fs_fs__close_revision_file().

Patch by: Evgeny Kotkov <evgeny.kotkov{_AT_}visualsvn.com>

r1549770 | brane | 2013-12-10 00:55:19 -0600 (Tue, 10 Dec 2013)

Avoid initializing svn_fs_id_t parts with pointers to stack variables, which
will eventually become dangling.

* subversion/libsvn_fs_fs/id.c
  (svn_fs_fs__id_txn_create_root, svn_fs_fs__id_create_root,
   svn_fs_fs__id_txn_create, svn_fs_fs__id_rev_create, svn_fs_fs__id_parse):
   Fix the erroneous FSAP_DATA initialization with an address of a temporary.
* subversion/libsvn_fs_x/id.c
  (svn_fs_x__id_txn_create_root, svn_fs_x__id_create_root,
   svn_fs_x__id_txn_create, svn_fs_x__id_rev_create, svn_fs_x__id_parse):
   Fix the erroneous FSAP_DATA initialization with an address of a temporary.

Patch by: Evgeny Kotkov

r1549766 | brane | 2013-12-10 00:39:45 -0600 (Tue, 10 Dec 2013)

Avoid undefined behavior (and crashing) within FSFS and FSX when
there is no changes cache.

* subversion/libsvn_fs_fs/cached_data.c
  (svn_fs_fs__get_changes): Avoid possible uninitialized variable access by
    setting FOUND to FALSE in case we do not have a CHANGES_CACHE.
* subversion/libsvn_fs_x/cached_data.c
  (svn_fs_x__get_changes): Avoid possible uninitialized variable access by
    setting FOUND to FALSE in case we do not have CHANGES_CACHE and

Patch by: Evgeny Kotkov

r1548706 | breser | 2013-12-06 13:54:50 -0600 (Fri, 06 Dec 2013)

Do not ignore --bin parameter for svnrdump when running Python tests.

* subversion/tests/cmdline/svntest/main.py
  (svnrdump_binary): Update obsolete comment.
  (execute_tests): Override default svnrdump path when --bin option is set.

Patch by: Evgeny Kotkov <evgeny.kotkov{_AT_}visualsvn.com>

r1547489 | stefan2 | 2013-12-03 11:25:07 -0600 (Tue, 03 Dec 2013)

Rework the "recover --pre-1.4-compatible" svnadmin test.  Bump the
MINOR_VERSION of the created repository to 3, because FSFS repositories with
MINOR_VERSION = 0 is prohibited since r1494223 (and creating a repository with
MINOR_VERSION = 3 does the same as the 'svnadmin create --pre-1.4-compatible'
call).  Use run_and_verify_svnadmin instead of run_svnadmin so that the test
actually checks the result of the call instead of always reporting false

* subversion/tests/cmdline/svnadmin_tests.py
  (recover_old): Bump MINOR_VERSION to 3, use run_and_verify_svnadmin instead
    of run_svnadmin.

Patch by: Evgeny Kotkov <evgeny.kotkov{_AT_}visualsvn.com>

r1547488 | stefan2 | 2013-12-03 11:22:07 -0600 (Tue, 03 Dec 2013)

Correctly handle the absence of MINOR_VERSION when creating test repositories
in the 'create_repos' helper.  "if not MINOR_VERSION" in this case is
equivalent to "if MINOR_VERSION is None or MINOR_VERSION == 0", which behaves
incorrectly for the case when the caller actually passes MINOR_VERSION = 0.
Follow-up to r1245799.

* subversion/tests/cmdline/svntest/main.py
  (create_repos): Use "if is None" instead of "if not" when checking the
    MINOR_VERSION for absence.

Patch by: Evgeny Kotkov <evgeny.kotkov{_AT_}visualsvn.com>

r1547486 | stefan2 | 2013-12-03 11:20:28 -0600 (Tue, 03 Dec 2013)

Fix 'svnadmin recover' regression crash with old repositories
(--compatible-version=1.3 / 1.2 / 1.1).  Follow-up to r1532029.

* subversion/libsvn_fs_fs/recovery.c
  (svn_fs_fs__find_max_ids): Call svn_fs_fs__open_pack_or_rev_file in order to
    initialize REV_FILE before passing it as an argument to other functions
    (namely, svn_fs_fs__item_offset).

Patch by: Evgeny Kotkov <evgeny.kotkov{_AT_}visualsvn.com>

r1547421 | cmpilato | 2013-12-03 09:11:04 -0600 (Tue, 03 Dec 2013)

Remove duplicate calls to svn_pool_clear().  Follow-up to r1546842.

* subversion/libsvn_fs_fs/recovery.c
  (recover_get_largest_revision): Remove duplicate calls to

Patch by: Evgeny Kotkov <evgeny.kotkov{_AT_}visualsvn.com>

r1546974 | philip | 2013-12-02 06:15:18 -0600 (Mon, 02 Dec 2013)

Fix the "Failed to parse version number string '1.3.0(null)'" error when
running svnadmin create --pre-1.x-compatible.  Follow-up to r1509915.

* subversion/svnadmin/svnadmin.c
  (subcommand_create): Correctly handle the absense of COMPATIBLE_VERSION->TAG
    when setting the SVN_FS_CONFIG_COMPATIBLE_VERSION.  If 'svnadmin create' is
    called with one of the --pre-1.x-compatible options, the TAG is NULL, so we
    should avoid constructing unparseable version strings like "1.3.0(null)".

Patch by: Evgeny Kotkov <evgeny.kotkov{_AT_}visualsvn.com>

r1518169 | ivan | 2013-08-28 06:46:36 -0500 (Wed, 28 Aug 2013)

Factor out some of the error and pool handling in the main() functions of 
svnrdump as it was done for svn/svnadmin in r1368252.

* subversion/svnrdump/svnrdump.c
  (SVNRDUMP_ERR): Remove this macro.
  (EXIT_ERROR, SVN_INT_ERR): New macros, same as those defined in
   subversion/svn/svn.c, but for svnrdump.
  (submain): Extract most of main() into this new function. Use 
   SVN_INT_ERR and EXIT_ERROR to handle errors.
  (main): Extract everything except the initialization of the application
   and of the top-level pool, and the destruction of that pool, into the
   new function sub_main(), and call that.

Patch by: Evgeny Kotkov <evgeny.kotkov{_AT_}visualsvn.com>

r1507993 | philip | 2013-07-29 05:11:50 -0500 (Mon, 29 Jul 2013)

Fix the out-of-bounds memory access in test_string_matching_test.  Follow-up
to r1505336.

* subversion/tests/libsvn_subr/string-test.c
  (test_string_matching): Correctly initialize the 'max_match' value to avoid
    out-of-bounds memory access.

Patch by: Evgeny Kotkov <evgeny.kotkov{_AT_}visualsvn.com>

r1500680 | stsp | 2013-07-08 07:07:35 -0500 (Mon, 08 Jul 2013)

Use local style for paths when formatting error messages from the
'svn diff --old A --new B' commands.  Follow-up to r1310291.

* subversion/libsvn_client/diff_local.c
  (svn_client__arbitrary_nodes_diff): Use local style for paths when formatting
    the "not the same node kind" and "not a file or directory" messages.

Patch by: Evgeny Kotkov <evgeny.kotkov{_AT_}visualsvn.com>

r1500074 | danielsh | 2013-07-05 12:21:09 -0500 (Fri, 05 Jul 2013)

Properly format the error message during unintended switches.

* subversion/libsvn_client/cmdline/switch.c
  (switch_internal): Use local style for paths when formatting the "no common
    ancestry" error message.

Patch by: Evgeny Kotkov <evgeny.kotkov{_AT_}visualsvn.com>

r1439992 | breser | 2013-01-29 10:44:47 -0600 (Tue, 29 Jan 2013)

Add two tests for the 'svnauthz --groups-file' behavior.  Follow-up to r1438407.

* subversion/tests/cmdline/svnauthz_tests.py
  (svnauthz_accessof_groups_repo_test, svnauthz_accessof_groups_file_test):
    New tests.
  (test_list): Add new tests.

Patch by: Evgeny Kotkov <evgeny.kotkov{_AT_}visualsvn.com>

r1438407 | ivan | 2013-01-25 03:59:30 -0600 (Fri, 25 Jan 2013)

Introduce AuthzSVNGroupsFile option to allow Subversion configurations with 
groups stored in a separate file.

* subversion/include/svn_config.h

* subversion/include/svn_repos.h
  (SVN_REPOS__CONF_GROUPS): New define.
  (svn_repos_authz_read2): New optional 'groups_path' parameter.
  (svn_repos_authz_parse): New optional 'groups_stream' parameter.

* subversion/libsvn_repos/authz.c
  (authz_copy_group): Introduce a callback for groups copying.
  (authz_copy_groups): Introduce a helper routine to copy groups from a
    specified config to the authz structure. Report error if the
    destination authz already contains group definitions.
  (svn_repos__authz_read): Support the 'groups_path' parameter. If it is set,
    parse the corresponding groups config and copy the groups to the
    resulting authz structure using authz_copy_groups.
  (svn_repos_authz_read2): New optional 'groups_path' parameter.
  (svn_repos_authz_read): Support the 'groups_stream' parameter. If it is
    set, parse the corresponding groups config stream and copy the groups
    to the resulting authz structure.

* subversion/libsvn_repos/deprecated.c
  (svn_repos_authz_read): Pass NULL as the 'groups_path' parameter when
    calling svn_repos__authz_read.

* subversion/libsvn_repos/repos.h
  (svn_repos__authz_read): New optional 'groups_path' parameter.

* subversion/libsvn_repos/repos.с
  (create_conf): Explain the purpose of the new groups-db option.

* subversion/mod_authz_svn/mod_authz_svn.c
  (authz_svn_config_rec): Add the 'groups_file' config member.
  (AuthzSVNGroupsFile_cmd): Introduce a function to canonicalize the groups
    file config value.
  (authz_svn_cmds): Add the AuthzSVNGroupsFile option.
  (get_access_conf): Log the path to the groups file if it is set. Pass the
    groups file path to svn_repos_authz_read2.

* subversion/svnserve/serve.c
  (canonicalize_access_file): New function. Factored out from
    load_authz_config to be reused for the groups file.
  (load_authz_config): Retrieve the SVN_CONFIG_OPTION_GROUPS_DB from the
    svnserve config. Canonicalize this value if it is present and pass
    it to svn_repos_authz_read2 when loading the authz configuration.

* tools/server-side/svnauthz.c
  (svnauthz_opt_state): Add the 'groups_file' member.
  (svnauthz__cmdline_options_t): Add the svnauthz__groups_file enum member.
  (options_table): Add the --groups-file option and short description for it.
  (cmd_table): Update the documentation to reflect the added
    svnauthz__groups_file option.
  (read_file_contents): New function. Factored out from get_authz_from_txn to
    be reused for the groups file contents.
  (get_authz_from_txn): Use read_file_contents for both authz and groups
    files. Pass the resulting contents to svn_repos_authz_parse.
  (get_authz): Pass the groups file from options to get_authz_from_txn
    or svn_repos_authz_read2 depending on whether transaction option is set.
  (canonicalize_access_file): New function. Factored out from
    sub_main to be reused for the groups file.
  (sub_main): Grab the groups file option from the command line, canonicalize
    it if it present and pass it further as a part of the opt_state.

* subversion/tests/libsvn_repos/repos-test.c
  (authz-get-handle, in_repo_authz): Pass NULL as the 'groups_path' parameter
    when calling svn_repos_authz_read2. Pass NULL as the 'groups_stream'
    parameter when calling svn_repos_authz_parse.
  (authz_groups_get_handle): Introduce the helper routine for tests similiar
    to authz_get_handle but supporting a separate groups file.
  (groups_authz, in_repo_groups_authz): Add.

* subversion/tests/cmdline/authz_tests.py
  (authz_svnserve_groups): Add the access test for svnserve configured with
    a separate groups file.
  (test_list): Add a reference to the new test.

* subversion/tests/cmdline/svntest/main.py
  (write_restrictive_svnserve_conf_with_groups): New method. Creates a
    default restrictive svnserve configuration with a separate groups file.
  (write_groups_file): Introduce a helper method to write the groups file
    in tests.

* subversion/tests/cmdline/svntest/sandbox.py
  (_set_name): Store the default path to the groups file in the
    'Sandbox.groups_file' variable.

* subversion/mod_authz_svn/INSTALL
  (II.1): Describe usage of AuthzSVNGroupsFile directive.

Patch by: Evgeny Kotkov <evgeny.kotkov{_AT_}visualsvn.com>

r1435252 | danielsh | 2013-01-18 11:09:10 -0600 (Fri, 18 Jan 2013)

Add the command table sentinel for 'svnauthz'.  Follow-up to r1428209.

* tools/server-side/svnauthz.c
  (cmd_table): Add the command table sentinel.

Patch by: Evgeny Kotkov <evgeny.kotkov{_AT_}visualsvn.com>