Modified: subversion/branches/1.8.x-r1643074/subversion/mod_dav_svn/reports/log.c URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1643074/subversion/mod_dav_svn/reports/log.c?rev=1659622&r1=1659621&r2=1659622&view=diff ============================================================================== --- subversion/branches/1.8.x-r1643074/subversion/mod_dav_svn/reports/log.c (original) +++ subversion/branches/1.8.x-r1643074/subversion/mod_dav_svn/reports/log.c Fri Feb 13 17:36:25 2015 @@ -307,6 +307,9 @@ dav_svn__log_report(const dav_resource * = apr_array_make(resource->pool, 1, sizeof(const char *)); /* Sanity check. */ + if (!resource->info->repos_path) + return dav_svn__new_error(resource->pool, HTTP_BAD_REQUEST, 0, + "The request does not specify a repository path"); ns = dav_svn__find_ns(doc->namespaces, SVN_XML_NAMESPACE); if (ns == -1) {
Modified: subversion/branches/1.8.x-r1643074/subversion/mod_dav_svn/reports/mergeinfo.c URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1643074/subversion/mod_dav_svn/reports/mergeinfo.c?rev=1659622&r1=1659621&r2=1659622&view=diff ============================================================================== --- subversion/branches/1.8.x-r1643074/subversion/mod_dav_svn/reports/mergeinfo.c (original) +++ subversion/branches/1.8.x-r1643074/subversion/mod_dav_svn/reports/mergeinfo.c Fri Feb 13 17:36:25 2015 @@ -67,6 +67,9 @@ dav_svn__get_mergeinfo_report(const dav_ = apr_array_make(resource->pool, 0, sizeof(const char *)); /* Sanity check. */ + if (!resource->info->repos_path) + return dav_svn__new_error(resource->pool, HTTP_BAD_REQUEST, 0, + "The request does not specify a repository path"); ns = dav_svn__find_ns(doc->namespaces, SVN_XML_NAMESPACE); if (ns == -1) { Modified: subversion/branches/1.8.x-r1643074/subversion/mod_dav_svn/repos.c URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1643074/subversion/mod_dav_svn/repos.c?rev=1659622&r1=1659621&r2=1659622&view=diff ============================================================================== --- subversion/branches/1.8.x-r1643074/subversion/mod_dav_svn/repos.c (original) +++ subversion/branches/1.8.x-r1643074/subversion/mod_dav_svn/repos.c Fri Feb 13 17:36:25 2015 @@ -508,6 +508,9 @@ parse_vtxnstub_uri(dav_resource_combined if (parse_txnstub_uri(comb, path, label, use_checked_in)) return TRUE; + if (!comb->priv.root.txn_name) + return TRUE; + comb->priv.root.vtxn_name = comb->priv.root.txn_name; comb->priv.root.txn_name = dav_svn__get_txn(comb->priv.repos, comb->priv.root.vtxn_name); @@ -576,6 +579,9 @@ parse_vtxnroot_uri(dav_resource_combined if (parse_txnroot_uri(comb, path, label, use_checked_in)) return TRUE; + if (!comb->priv.root.txn_name) + return TRUE; + comb->priv.root.vtxn_name = comb->priv.root.txn_name; comb->priv.root.txn_name = dav_svn__get_txn(comb->priv.repos, comb->priv.root.vtxn_name); @@ -921,6 +927,10 @@ prep_working(dav_resource_combined *comb point. */ if (txn_name == NULL) { + if (!comb->priv.root.activity_id) + return dav_svn__new_error(comb->res.pool, HTTP_BAD_REQUEST, 0, + "The request did not specify an activity ID"); + txn_name = dav_svn__get_txn(comb->priv.repos, comb->priv.root.activity_id); if (txn_name == NULL) @@ -1031,8 +1041,13 @@ prep_working(dav_resource_combined *comb static dav_error * prep_activity(dav_resource_combined *comb) { - const char *txn_name = dav_svn__get_txn(comb->priv.repos, - comb->priv.root.activity_id); + const char *txn_name; + + if (!comb->priv.root.activity_id) + return dav_svn__new_error(comb->res.pool, HTTP_BAD_REQUEST, 0, + "The request did not specify an activity ID"); + + txn_name = dav_svn__get_txn(comb->priv.repos, comb->priv.root.activity_id); comb->priv.root.txn_name = txn_name; comb->res.exists = txn_name != NULL; @@ -4144,7 +4159,9 @@ typedef struct walker_ctx_t { static dav_error * -do_walk(walker_ctx_t *ctx, int depth) +do_walk(walker_ctx_t *ctx, + int depth, + apr_pool_t *scratch_pool) { const dav_walk_params *params = ctx->params; int isdir = ctx->res.collection; @@ -4217,19 +4234,19 @@ do_walk(walker_ctx_t *ctx, int depth) svn_log__get_dir(ctx->info.repos_path, ctx->info.root.rev, TRUE, FALSE, SVN_DIRENT_ALL, - params->pool)); + scratch_pool)); /* fetch this collection's children */ serr = svn_fs_dir_entries(&children, ctx->info.root.root, - ctx->info.repos_path, params->pool); + ctx->info.repos_path, scratch_pool); if (serr != NULL) return dav_svn__convert_err(serr, HTTP_INTERNAL_SERVER_ERROR, "could not fetch collection members", params->pool); /* iterate over the children in this collection */ - iterpool = svn_pool_create(params->pool); - for (hi = apr_hash_first(params->pool, children); hi; hi = apr_hash_next(hi)) + iterpool = svn_pool_create(scratch_pool); + for (hi = apr_hash_first(scratch_pool, children); hi; hi = apr_hash_next(hi)) { const void *key; apr_ssize_t klen; @@ -4282,7 +4299,7 @@ do_walk(walker_ctx_t *ctx, int depth) ctx->res.uri = ctx->uri->data; /* recurse on this collection */ - err = do_walk(ctx, depth - 1); + err = do_walk(ctx, depth - 1, iterpool); if (err != NULL) return err; @@ -4364,7 +4381,7 @@ walk(const dav_walk_params *params, int /* ### is the root already/always open? need to verify */ /* always return the error, and any/all multistatus responses */ - err = do_walk(&ctx, depth); + err = do_walk(&ctx, depth, params->pool); *response = ctx.wres.response; return err; Modified: subversion/branches/1.8.x-r1643074/subversion/svnadmin/svnadmin.c URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1643074/subversion/svnadmin/svnadmin.c?rev=1659622&r1=1659621&r2=1659622&view=diff ============================================================================== --- subversion/branches/1.8.x-r1643074/subversion/svnadmin/svnadmin.c (original) +++ subversion/branches/1.8.x-r1643074/subversion/svnadmin/svnadmin.c Fri Feb 13 17:36:25 2015 @@ -1084,7 +1084,7 @@ subcommand_freeze(apr_getopt_t *os, void } b.command = APR_ARRAY_IDX(args, 0, const char *); - b.args = apr_palloc(pool, sizeof(char *) * args->nelts + 1); + b.args = apr_palloc(pool, sizeof(char *) * (args->nelts + 1)); for (i = 0; i < args->nelts; ++i) b.args[i] = APR_ARRAY_IDX(args, i, const char *); b.args[args->nelts] = NULL; Modified: subversion/branches/1.8.x-r1643074/subversion/tests/cmdline/davautocheck.sh URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1643074/subversion/tests/cmdline/davautocheck.sh?rev=1659622&r1=1659621&r2=1659622&view=diff ============================================================================== --- subversion/branches/1.8.x-r1643074/subversion/tests/cmdline/davautocheck.sh (original) +++ subversion/branches/1.8.x-r1643074/subversion/tests/cmdline/davautocheck.sh Fri Feb 13 17:36:25 2015 @@ -417,9 +417,17 @@ User $(id -un) Group $(id -gn) __EOF__ else +HTTPD_LOCK="$HTTPD_ROOT/lock" +mkdir "$HTTPD_LOCK" \ + || fail "couldn't create lock directory '$HTTPD_LOCK'" cat >> "$HTTPD_CFG" <<__EOF__ -# TODO: maybe uncomment this for prefork,worker MPMs only? -# Mutex file:lock mpm-accept +# worker and prefork MUST have a mpm-accept lockfile in 2.3.0+ +<IfModule worker.c> + Mutex "file:$HTTPD_LOCK" mpm-accept +</IfModule> +<IfModule prefork.c> + Mutex "file:$HTTPD_LOCK" mpm-accept +</IfModule> __EOF__ fi Modified: subversion/branches/1.8.x-r1643074/subversion/tests/libsvn_subr/cache-test.c URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1643074/subversion/tests/libsvn_subr/cache-test.c?rev=1659622&r1=1659621&r2=1659622&view=diff ============================================================================== --- subversion/branches/1.8.x-r1643074/subversion/tests/libsvn_subr/cache-test.c (original) +++ subversion/branches/1.8.x-r1643074/subversion/tests/libsvn_subr/cache-test.c Fri Feb 13 17:36:25 2015 @@ -199,6 +199,67 @@ test_membuffer_cache_basic(apr_pool_t *p return basic_cache_test(cache, FALSE, pool); } +/* Implements svn_cache__deserialize_func_t */ +static svn_error_t * +raise_error_deserialize_func(void **out, + void *data, + apr_size_t data_len, + apr_pool_t *pool) +{ + return svn_error_create(APR_EGENERAL, NULL, NULL); +} + +/* Implements svn_cache__partial_getter_func_t */ +static svn_error_t * +raise_error_partial_getter_func(void **out, + const void *data, + apr_size_t data_len, + void *baton, + apr_pool_t *result_pool) +{ + return svn_error_create(APR_EGENERAL, NULL, NULL); +} + +static svn_error_t * +test_membuffer_serializer_error_handling(apr_pool_t *pool) +{ + svn_cache__t *cache; + svn_membuffer_t *membuffer; + svn_revnum_t twenty = 20; + svn_boolean_t found; + void *val; + + SVN_ERR(svn_cache__membuffer_cache_create(&membuffer, 10*1024, 1, 0, + TRUE, TRUE, pool)); + + /* Create a cache with just one entry. */ + SVN_ERR(svn_cache__create_membuffer_cache(&cache, + membuffer, + serialize_revnum, + raise_error_deserialize_func, + APR_HASH_KEY_STRING, + "cache:", + FALSE, + pool)); + + SVN_ERR(svn_cache__set(cache, "twenty", &twenty, pool)); + + /* Test retrieving data from cache using full getter that + always raises an error. */ + SVN_TEST_ASSERT_ERROR( + svn_cache__get(&val, &found, cache, "twenty", pool), + APR_EGENERAL); + + /* Test retrieving data from cache using partial getter that + always raises an error. */ + SVN_TEST_ASSERT_ERROR( + svn_cache__get_partial(&val, &found, cache, "twenty", + raise_error_partial_getter_func, + NULL, pool), + APR_EGENERAL); + + return SVN_NO_ERROR; +} static svn_error_t * test_memcache_long_key(const svn_test_opts_t *opts, @@ -269,5 +330,7 @@ struct svn_test_descriptor_t test_funcs[ "memcache svn_cache with very long keys"), SVN_TEST_PASS2(test_membuffer_cache_basic, "basic membuffer svn_cache test"), + SVN_TEST_PASS2(test_membuffer_serializer_error_handling, + "test for error handling in membuffer svn_cache"), SVN_TEST_NULL }; Modified: subversion/branches/1.8.x-r1643074/subversion/tests/libsvn_subr/string-test.c URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1643074/subversion/tests/libsvn_subr/string-test.c?rev=1659622&r1=1659621&r2=1659622&view=diff ============================================================================== --- subversion/branches/1.8.x-r1643074/subversion/tests/libsvn_subr/string-test.c (original) +++ subversion/branches/1.8.x-r1643074/subversion/tests/libsvn_subr/string-test.c Fri Feb 13 17:36:25 2015 @@ -569,7 +569,19 @@ test_stringbuf_insert(apr_pool_t *pool) SVN_TEST_STRING_ASSERT(a->data, "test hello, world"); svn_stringbuf_insert(a, 1200, "!", 1); - return expect_stringbuf_equal(a, "test hello, world!", pool); + SVN_TEST_STRING_ASSERT(a->data, "test hello, world!"); + + svn_stringbuf_insert(a, 4, "\0-\0", 3); + SVN_TEST_ASSERT(svn_stringbuf_compare(a, + svn_stringbuf_ncreate("test\0-\0 hello, world!", + 21, pool))); + + svn_stringbuf_insert(a, 14, a->data + 4, 3); + SVN_TEST_ASSERT(svn_stringbuf_compare(a, + svn_stringbuf_ncreate("test\0-\0 hello,\0-\0 world!", + 24, pool))); + + return SVN_NO_ERROR; } static svn_error_t * @@ -608,8 +620,24 @@ test_stringbuf_replace(apr_pool_t *pool) SVN_TEST_STRING_ASSERT(a->data, "test hello, world!"); svn_stringbuf_replace(a, 1200, 199, "!!", 2); + SVN_TEST_STRING_ASSERT(a->data, "test hello, world!!!"); + + svn_stringbuf_replace(a, 10, 2, "\0-\0", 3); + SVN_TEST_ASSERT(svn_stringbuf_compare(a, + svn_stringbuf_ncreate("test hello\0-\0world!!!", + 21, pool))); + + svn_stringbuf_replace(a, 10, 3, a->data + 10, 3); + SVN_TEST_ASSERT(svn_stringbuf_compare(a, + svn_stringbuf_ncreate("test hello\0-\0world!!!", + 21, pool))); + + svn_stringbuf_replace(a, 19, 1, a->data + 10, 3); + SVN_TEST_ASSERT(svn_stringbuf_compare(a, + svn_stringbuf_ncreate("test hello\0-\0world!\0-\0!", + 23, pool))); - return expect_stringbuf_equal(a, "test hello, world!!!", pool); + return SVN_NO_ERROR; } static svn_error_t *
