On Wed, Mar 27, 2013 at 3:55 PM, <stsp_at_apache.org> wrote:
> Author: stsp
> Date: Wed Mar 27 11:55:10 2013
> New Revision: 1461542
>
> URL: http://svn.apache.org/r1461542
> Log:
> Follow-up to r1461535:
>
> * subversion/tests/libsvn_repos/repos-test.c
> (filename_trailing_newline): Tweak this test to verify behaviour of
> the repos layer, not the FS layer. Current consensus seems to be that
> the FS API should allow such names, and the repos layer should reject
> them. So expect a commit of the transaction via the repos API to fail,
> rather than expecting the FS layer to reject the creation of filenames
> with trailing newlines in transactions.
>
> Modified:
> subversion/trunk/subversion/tests/libsvn_repos/repos-test.c
>
> Modified: subversion/trunk/subversion/tests/libsvn_repos/repos-test.c
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_repos/repos-test.c?rev=1461542&r1=1461541&r2=1461542&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/tests/libsvn_repos/repos-test.c (original)
> +++ subversion/trunk/subversion/tests/libsvn_repos/repos-test.c Wed Mar 27 11:55:10 2013
> @@ -3192,15 +3192,26 @@ filename_trailing_newline(const svn_test
> svn_pool_clear(subpool);
>
> /* Attempt to copy /foo to "/bar\n". This should fail. */
> + youngest_rev = 1;
> SVN_ERR(svn_fs_begin_txn(&txn, fs, youngest_rev, subpool));
> SVN_ERR(svn_fs_txn_root(&txn_root, txn, subpool));
> SVN_ERR(svn_fs_revision_root(&root, fs, youngest_rev, subpool));
> - err = svn_fs_copy(root, "/foo", txn_root, "/bar\n", subpool);
> + SVN_ERR(svn_fs_copy(root, "/foo", txn_root, "/bar\n", subpool));
> + err = svn_repos_fs_commit_txn(NULL, repos, &youngest_rev, txn, subpool);
> SVN_TEST_ASSERT(err != SVN_NO_ERROR);
> + svn_error_clear(err);
> + svn_pool_clear(subpool);
>
> - /* Attempt to create a file /foo/baz\n. This should fail. */
> - err = svn_fs_make_file(txn_root, "/foo/baz\n", subpool);
> + /* Attempt to commit a file /foo/baz\n. This should fail. */
> + youngest_rev = 1;
> + SVN_ERR(svn_fs_begin_txn(&txn, fs, youngest_rev, subpool));
> + SVN_ERR(svn_fs_txn_root(&txn_root, txn, subpool));
> + SVN_ERR(svn_fs_revision_root(&root, fs, youngest_rev, subpool));
> + SVN_ERR(svn_fs_make_file(txn_root, "/foo/baz\n", subpool));
I think easiest way to block these paths in svn_fs_make_file() not in
commit_txn(). We already perform path validation in make_file().
--
Ivan Zhakov
Received on 2013-03-27 13:56:41 CET