Modified: subversion/branches/fsx-1.10/subversion/svnmucc/svnmucc.c URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/svnmucc/svnmucc.c?rev=1685464&r1=1685463&r2=1685464&view=diff ============================================================================== --- subversion/branches/fsx-1.10/subversion/svnmucc/svnmucc.c (original) +++ subversion/branches/fsx-1.10/subversion/svnmucc/svnmucc.c Sun Jun 14 20:58:10 2015 @@ -295,18 +295,16 @@ help(FILE *stream, apr_pool_t *pool) " prompt only if standard input is a terminal)\n" " --force-interactive : do interactive prompting even if standard\n" " input is not a terminal\n" - " --trust-server-cert : deprecated; same as --trust-unknown-ca\n" - " --trust-unknown-ca : with --non-interactive, accept SSL server\n" - " certificates from unknown certificate authorities\n" - " --trust-cn-mismatch : with --non-interactive, accept SSL server\n" - " certificates even if the server hostname does not\n" - " match the certificate's common name attribute\n" - " --trust-expired : with --non-interactive, accept expired SSL server\n" - " certificates\n" - " --trust-not-yet-valid : with --non-interactive, accept SSL server\n" - " certificates from the future\n" - " --trust-other-failure : with --non-interactive, accept SSL server\n" - " certificates with failures other than the above\n" + " --trust-server-cert : deprecated;\n" + " same as --trust-server-cert-failures=unknown-ca\n" + " --trust-server-cert-failures ARG\n" + " with --non-interactive, accept SSL server\n" + " certificates with failures; ARG is comma-separated\n" + " list of 'unknown-ca' (Unknown Authority),\n" + " 'cn-mismatch' (Hostname mismatch), 'expired'\n" + " (Expired certificate),'not-yet-valid' (Not yet\n" + " valid certificate) and 'other' (all other not\n" + " separately classified certificate errors).\n" " -X [--extra-args] ARG : append arguments from file ARG (one per line;\n" " use \"-\" to read from standard input)\n" " --config-dir ARG : use ARG to override the config directory\n" @@ -472,11 +470,7 @@ sub_main(int *exit_code, int argc, const non_interactive_opt, force_interactive_opt, trust_server_cert_opt, - trust_server_cert_unknown_ca_opt, - trust_server_cert_cn_mismatch_opt, - trust_server_cert_expired_opt, - trust_server_cert_not_yet_valid_opt, - trust_server_cert_other_failure_opt, + trust_server_cert_failures_opt, }; static const apr_getopt_option_t options[] = { {"message", 'm', 1, ""}, @@ -492,11 +486,7 @@ sub_main(int *exit_code, int argc, const {"non-interactive", non_interactive_opt, 0, ""}, {"force-interactive", force_interactive_opt, 0, ""}, {"trust-server-cert", trust_server_cert_opt, 0, ""}, - {"trust-unknown-ca", trust_server_cert_unknown_ca_opt, 0, ""}, - {"trust-cn-mismatch", trust_server_cert_cn_mismatch_opt, 0, ""}, - {"trust-expired", trust_server_cert_expired_opt, 0, ""}, - {"trust-not-yet-valid", trust_server_cert_not_yet_valid_opt, 0, ""}, - {"trust-other-failure", trust_server_cert_other_failure_opt, 0, ""}, + {"trust-server-cert-failures", trust_server_cert_failures_opt, 1, ""}, {"config-dir", config_dir_opt, 1, ""}, {"config-option", config_inline_opt, 1, ""}, {"no-auth-cache", no_auth_cache_opt, 0, ""}, @@ -604,20 +594,17 @@ sub_main(int *exit_code, int argc, const force_interactive = TRUE; break; case trust_server_cert_opt: /* backward compat */ - case trust_server_cert_unknown_ca_opt: trust_unknown_ca = TRUE; break; - case trust_server_cert_cn_mismatch_opt: - trust_cn_mismatch = TRUE; - break; - case trust_server_cert_expired_opt: - trust_expired = TRUE; - break; - case trust_server_cert_not_yet_valid_opt: - trust_not_yet_valid = TRUE; - break; - case trust_server_cert_other_failure_opt: - trust_other_failure = TRUE; + case trust_server_cert_failures_opt: + SVN_ERR(svn_utf_cstring_to_utf8(&opt_arg, arg, pool)); + SVN_ERR(svn_cmdline__parse_trust_options( + &trust_unknown_ca, + &trust_cn_mismatch, + &trust_expired, + &trust_not_yet_valid, + &trust_other_failure, + opt_arg, pool)); break; case config_dir_opt: SVN_ERR(svn_utf_cstring_to_utf8(&config_dir, arg, pool)); @@ -625,6 +612,7 @@ sub_main(int *exit_code, int argc, const case config_inline_opt: SVN_ERR(svn_utf_cstring_to_utf8(&opt_arg, arg, pool)); SVN_ERR(svn_cmdline__parse_config_option(config_options, opt_arg, + "svnmucc: ", pool)); break; case no_auth_cache_opt: @@ -664,25 +652,10 @@ sub_main(int *exit_code, int argc, const if (!non_interactive) { - if (trust_unknown_ca) - return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL, - _("--trust-unknown-ca requires " - "--non-interactive")); - if (trust_cn_mismatch) - return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL, - _("--trust-cn-mismatch requires " - "--non-interactive")); - if (trust_expired) - return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL, - _("--trust-expired requires " - "--non-interactive")); - if (trust_not_yet_valid) - return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL, - _("--trust-not-yet-valid requires " - "--non-interactive")); - if (trust_other_failure) + if (trust_unknown_ca || trust_cn_mismatch || trust_expired + || trust_not_yet_valid || trust_other_failure) return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL, - _("--trust-other-failure requires " + _("--trust-server-cert-failures requires " "--non-interactive")); }
Modified: subversion/branches/fsx-1.10/subversion/svnrdump/dump_editor.c URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/svnrdump/dump_editor.c?rev=1685464&r1=1685463&r2=1685464&view=diff ============================================================================== --- subversion/branches/fsx-1.10/subversion/svnrdump/dump_editor.c (original) +++ subversion/branches/fsx-1.10/subversion/svnrdump/dump_editor.c Sun Jun 14 20:58:10 2015 @@ -879,7 +879,7 @@ close_file(void *file_baton, { struct file_baton *fb = file_baton; struct dump_edit_baton *eb = fb->eb; - apr_finfo_t *info = apr_pcalloc(pool, sizeof(apr_finfo_t)); + svn_filesize_t text_content_length = 0; svn_stringbuf_t *propstring = NULL; svn_repos__dumpfile_headers_t *headers; @@ -903,15 +903,12 @@ close_file(void *file_baton, /* Dump the text headers */ if (fb->dump_text) { - apr_status_t err; - /* Text-delta: true */ svn_repos__dumpfile_header_push( headers, SVN_REPOS_DUMPFILE_TEXT_DELTA, "true"); - err = apr_file_info_get(info, APR_FINFO_SIZE, eb->delta_file); - if (err) - SVN_ERR(svn_error_wrap_apr(err, NULL)); + SVN_ERR(svn_io_file_size_get(&text_content_length, eb->delta_file, + pool)); if (fb->base_checksum) /* Text-delta-base-md5: */ @@ -925,7 +922,7 @@ close_file(void *file_baton, /* Dump the headers and props now */ SVN_ERR(svn_repos__dump_node_record(eb->stream, headers, propstring, - fb->dump_text, info->size, + fb->dump_text, text_content_length, FALSE /*content_length_always*/, pool)); Modified: subversion/branches/fsx-1.10/subversion/svnrdump/load_editor.c URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/svnrdump/load_editor.c?rev=1685464&r1=1685463&r2=1685464&view=diff ============================================================================== --- subversion/branches/fsx-1.10/subversion/svnrdump/load_editor.c (original) +++ subversion/branches/fsx-1.10/subversion/svnrdump/load_editor.c Sun Jun 14 20:58:10 2015 @@ -392,7 +392,7 @@ new_revision_record(void **revision_bato { struct revision_baton *rb; struct parse_baton *pb; - apr_hash_index_t *hi; + const char *rev_str; svn_revnum_t head_rev; rb = apr_pcalloc(pool, sizeof(*rb)); @@ -401,14 +401,9 @@ new_revision_record(void **revision_bato rb->pb = pb; rb->db = NULL; - for (hi = apr_hash_first(pool, headers); hi; hi = apr_hash_next(hi)) - { - const char *hname = apr_hash_this_key(hi); - const char *hval = apr_hash_this_val(hi); - - if (strcmp(hname, SVN_REPOS_DUMPFILE_REVISION_NUMBER) == 0) - rb->rev = atoi(hval); - } + rev_str = svn_hash_gets(headers, SVN_REPOS_DUMPFILE_REVISION_NUMBER); + if (rev_str) + rb->rev = SVN_STR_TO_REV(rev_str); SVN_ERR(svn_ra_get_latest_revnum(pb->session, &head_rev, pool)); @@ -499,6 +494,7 @@ new_node_record(void **node_baton, const struct svn_delta_editor_t *commit_editor = rb->pb->commit_editor; void *commit_edit_baton = rb->pb->commit_edit_baton; struct node_baton *nb; + svn_revnum_t head_rev_before_commit = rb->rev - rb->rev_offset - 1; apr_hash_index_t *hi; void *child_baton; const char *nb_dirname; @@ -537,7 +533,7 @@ new_node_record(void **node_baton, rb->pb->commit_edit_baton = commit_edit_baton; SVN_ERR(commit_editor->open_root(commit_edit_baton, - rb->rev - rb->rev_offset - 1, + head_rev_before_commit, rb->pool, &child_baton)); /* child_baton corresponds to the root directory baton here */ @@ -570,7 +566,7 @@ new_node_record(void **node_baton, if (strcmp(hname, SVN_REPOS_DUMPFILE_TEXT_DELTA_BASE_MD5) == 0) nb->base_checksum = apr_pstrdup(rb->pool, hval); if (strcmp(hname, SVN_REPOS_DUMPFILE_NODE_COPYFROM_REV) == 0) - nb->copyfrom_rev = atoi(hval); + nb->copyfrom_rev = SVN_STR_TO_REV(hval); if (strcmp(hname, SVN_REPOS_DUMPFILE_NODE_COPYFROM_PATH) == 0) nb->copyfrom_path = apr_pstrdup(rb->pool, hval); } @@ -617,7 +613,7 @@ new_node_record(void **node_baton, rb->pool); SVN_ERR(commit_editor->open_directory(relpath_compose, rb->db->baton, - rb->rev - rb->rev_offset - 1, + head_rev_before_commit, rb->pool, &child_baton)); push_directory(rb, child_baton, relpath_compose, TRUE /*is_added*/, NULL, SVN_INVALID_REVNUM); @@ -659,7 +655,8 @@ new_node_record(void **node_baton, { case svn_node_action_delete: case svn_node_action_replace: - SVN_ERR(commit_editor->delete_entry(nb->path, rb->rev - rb->rev_offset, + SVN_ERR(commit_editor->delete_entry(nb->path, + head_rev_before_commit, rb->db->baton, rb->pool)); if (nb->action == svn_node_action_delete) break; @@ -697,7 +694,7 @@ new_node_record(void **node_baton, break; default: SVN_ERR(commit_editor->open_directory(nb->path, rb->db->baton, - rb->rev - rb->rev_offset - 1, + head_rev_before_commit, rb->pool, &child_baton)); push_directory(rb, child_baton, nb->path, FALSE /*is_added*/, NULL, SVN_INVALID_REVNUM); @@ -987,6 +984,7 @@ close_revision(void *baton) } else { + svn_revnum_t head_rev_before_commit = rb->rev - rb->rev_offset - 1; void *child_baton; /* Legitimate revision with no node information */ @@ -996,7 +994,7 @@ close_revision(void *baton) NULL, FALSE, rb->pool)); SVN_ERR(commit_editor->open_root(commit_edit_baton, - rb->rev - rb->rev_offset - 1, + head_rev_before_commit, rb->pool, &child_baton)); SVN_ERR(commit_editor->close_directory(child_baton, rb->pool)); Modified: subversion/branches/fsx-1.10/subversion/svnrdump/svnrdump.c URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/svnrdump/svnrdump.c?rev=1685464&r1=1685463&r2=1685464&view=diff ============================================================================== --- subversion/branches/fsx-1.10/subversion/svnrdump/svnrdump.c (original) +++ subversion/branches/fsx-1.10/subversion/svnrdump/svnrdump.c Sun Jun 14 20:58:10 2015 @@ -85,11 +85,7 @@ enum svn_svnrdump__longopt_t opt_force_interactive, opt_incremental, opt_trust_server_cert, - opt_trust_server_cert_unknown_ca, - opt_trust_server_cert_cn_mismatch, - opt_trust_server_cert_expired, - opt_trust_server_cert_not_yet_valid, - opt_trust_server_cert_other_failure, + opt_trust_server_cert_failures, opt_version }; @@ -99,11 +95,7 @@ enum svn_svnrdump__longopt_t opt_auth_password, \ opt_auth_nocache, \ opt_trust_server_cert, \ - opt_trust_server_cert_unknown_ca, \ - opt_trust_server_cert_cn_mismatch, \ - opt_trust_server_cert_expired, \ - opt_trust_server_cert_not_yet_valid, \ - opt_trust_server_cert_other_failure, \ + opt_trust_server_cert_failures, \ opt_non_interactive, \ opt_force_interactive @@ -164,30 +156,24 @@ static const apr_getopt_option_t svnrdum "For example:\n" " " " servers:global:http-library=serf")}, - {"trust-server-cert", opt_trust_server_cert, 0, - N_("deprecated; same as --trust-unknown-ca")}, - {"trust-unknown-ca", opt_trust_server_cert_unknown_ca, 0, - N_("with --non-interactive, accept SSL server\n" - " " - "certificates from unknown certificate authorities")}, - {"trust-cn-mismatch", opt_trust_server_cert_cn_mismatch, 0, - N_("with --non-interactive, accept SSL server\n" - " " - "certificates even if the server hostname does not\n" - " " - "match the certificate's common name attribute")}, - {"trust-expired", opt_trust_server_cert_expired, 0, - N_("with --non-interactive, accept expired SSL server\n" - " " - "certificates")}, - {"trust-not-yet-valid", opt_trust_server_cert_not_yet_valid, 0, - N_("with --non-interactive, accept SSL server\n" - " " - "certificates from the future")}, - {"trust-other-failure", opt_trust_server_cert_other_failure, 0, - N_("with --non-interactive, accept SSL server\n" - " " - "certificates with failures other than the above")}, + {"trust-server-cert", opt_trust_server_cert, 0, + N_("deprecated; same as\n" + " " + "--trust-server-cert-failures=unknown-ca")}, + {"trust-server-cert-failures", opt_trust_server_cert_failures, 1, + N_("with --non-interactive, accept SSL server\n" + " " + "certificates with failures; ARG is comma-separated\n" + " " + "list of 'unknown-ca' (Unknown Authority),\n" + " " + "'cn-mismatch' (Hostname mismatch), 'expired'\n" + " " + "(Expired certificate), 'not-yet-valid' (Not yet\n" + " " + "valid certificate) and 'other' (all other not\n" + " " + "separately classified certificate errors).")}, {0, 0, 0, 0} }; @@ -927,20 +913,17 @@ sub_main(int *exit_code, int argc, const svn_hash_sets(opt_baton->skip_revprops, opt_arg, opt_arg); break; case opt_trust_server_cert: /* backward compat */ - case opt_trust_server_cert_unknown_ca: trust_unknown_ca = TRUE; break; - case opt_trust_server_cert_cn_mismatch: - trust_cn_mismatch = TRUE; - break; - case opt_trust_server_cert_expired: - trust_expired = TRUE; - break; - case opt_trust_server_cert_not_yet_valid: - trust_not_yet_valid = TRUE; - break; - case opt_trust_server_cert_other_failure: - trust_other_failure = TRUE; + case opt_trust_server_cert_failures: + SVN_ERR(svn_utf_cstring_to_utf8(&opt_arg, opt_arg, pool)); + SVN_ERR(svn_cmdline__parse_trust_options( + &trust_unknown_ca, + &trust_cn_mismatch, + &trust_expired, + &trust_not_yet_valid, + &trust_other_failure, + opt_arg, pool)); break; case opt_config_option: if (!config_options) @@ -950,7 +933,9 @@ sub_main(int *exit_code, int argc, const SVN_ERR(svn_utf_cstring_to_utf8(&opt_arg, opt_arg, pool)); SVN_ERR(svn_cmdline__parse_config_option(config_options, - opt_arg, pool)); + opt_arg, + "svnrdump: ", + pool)); } } @@ -1059,25 +1044,10 @@ sub_main(int *exit_code, int argc, const /* --trust-* can only be used with --non-interactive */ if (!non_interactive) { - if (trust_unknown_ca) - return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL, - _("--trust-unknown-ca requires " - "--non-interactive")); - if (trust_cn_mismatch) - return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL, - _("--trust-cn-mismatch requires " - "--non-interactive")); - if (trust_expired) - return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL, - _("--trust-expired requires " - "--non-interactive")); - if (trust_not_yet_valid) - return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL, - _("--trust-not-yet-valid requires " - "--non-interactive")); - if (trust_other_failure) + if (trust_unknown_ca || trust_cn_mismatch || trust_expired + || trust_not_yet_valid || trust_other_failure) return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL, - _("--trust-other-failure requires " + _("--trust-server-cert-failures requires " "--non-interactive")); } Modified: subversion/branches/fsx-1.10/subversion/svnserve/logger.c URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/svnserve/logger.c?rev=1685464&r1=1685463&r2=1685464&view=diff ============================================================================== --- subversion/branches/fsx-1.10/subversion/svnserve/logger.c (original) +++ subversion/branches/fsx-1.10/subversion/svnserve/logger.c Sun Jun 14 20:58:10 2015 @@ -58,7 +58,7 @@ logger__create_for_stderr(logger_t **log { logger_t *result = apr_pcalloc(pool, sizeof(*result)); result->pool = svn_pool_create(pool); - + SVN_ERR(svn_stream_for_stderr(&result->stream, pool)); SVN_ERR(svn_mutex__init(&result->mutex, TRUE, pool)); @@ -74,7 +74,7 @@ logger__create(logger_t **logger, { logger_t *result = apr_pcalloc(pool, sizeof(*result)); apr_file_t *file; - + SVN_ERR(svn_io_file_open(&file, filename, APR_WRITE | APR_CREATE | APR_APPEND, APR_OS_DEFAULT, pool)); @@ -145,7 +145,7 @@ logger__log_error(logger_t *logger, } svn_pool_clear(logger->pool); - + svn_error_clear(svn_mutex__unlock(logger->mutex, SVN_NO_ERROR)); } } Modified: subversion/branches/fsx-1.10/subversion/svnserve/serve.c URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/svnserve/serve.c?rev=1685464&r1=1685463&r2=1685464&view=diff ============================================================================== --- subversion/branches/fsx-1.10/subversion/svnserve/serve.c (original) +++ subversion/branches/fsx-1.10/subversion/svnserve/serve.c Sun Jun 14 20:58:10 2015 @@ -1779,12 +1779,9 @@ static svn_error_t *get_dir(svn_ra_svn_c if (dirent_fields & SVN_DIRENT_HAS_PROPS) { - apr_hash_t *file_props; - /* has_props */ - SVN_CMD_ERR(svn_fs_node_proplist(&file_props, root, file_path, + SVN_CMD_ERR(svn_fs_node_has_props(&has_props, root, file_path, subpool)); - has_props = (apr_hash_count(file_props) > 0); } if ((dirent_fields & SVN_DIRENT_LAST_AUTHOR) @@ -2179,7 +2176,7 @@ static svn_error_t *log_receiver(void *b } } SVN_ERR(svn_ra_svn__end_list(conn, pool)); - + /* send LOG_ENTRY main members */ SVN_ERR(svn_ra_svn__write_data_log_entry(conn, pool, log_entry->revision, @@ -2506,32 +2503,56 @@ static svn_error_t *get_location_segment abs_path = svn_fspath__join(b->repository->fs_path->data, relative_path, pool); - if (SVN_IS_VALID_REVNUM(start_rev) - && SVN_IS_VALID_REVNUM(end_rev) - && (end_rev > start_rev)) + SVN_ERR(trivial_auth_request(conn, pool, b)); + SVN_ERR(log_command(baton, conn, pool, "%s", + svn_log__get_location_segments(abs_path, peg_revision, + start_rev, end_rev, + pool))); + + /* No START_REV or PEG_REVISION? We'll use HEAD. */ + if (!SVN_IS_VALID_REVNUM(start_rev) || !SVN_IS_VALID_REVNUM(peg_revision)) { - err = svn_error_createf(SVN_ERR_INCORRECT_PARAMS, NULL, + svn_revnum_t youngest; + + err = svn_fs_youngest_rev(&youngest, b->repository->fs, pool); + + if (err) + { + err = svn_error_compose_create( + svn_ra_svn__write_word(conn, pool, "done"), + err); + + return log_fail_and_flush(err, b, conn, pool); + } + + if (!SVN_IS_VALID_REVNUM(start_rev)) + start_rev = youngest; + if (!SVN_IS_VALID_REVNUM(peg_revision)) + peg_revision = youngest; + } + + /* No END_REV? We'll use 0. */ + if (!SVN_IS_VALID_REVNUM(end_rev)) + end_rev = 0; + + if (end_rev > start_rev) + { + err = svn_ra_svn__write_word(conn, pool, "done"); + err = svn_error_createf(SVN_ERR_FS_NO_SUCH_REVISION, err, "Get-location-segments end revision must not be " "younger than start revision"); return log_fail_and_flush(err, b, conn, pool); } - if (SVN_IS_VALID_REVNUM(peg_revision) - && SVN_IS_VALID_REVNUM(start_rev) - && (start_rev > peg_revision)) + if (start_rev > peg_revision) { - err = svn_error_createf(SVN_ERR_INCORRECT_PARAMS, NULL, + err = svn_ra_svn__write_word(conn, pool, "done"); + err = svn_error_createf(SVN_ERR_FS_NO_SUCH_REVISION, err, "Get-location-segments start revision must not " "be younger than peg revision"); return log_fail_and_flush(err, b, conn, pool); } - SVN_ERR(trivial_auth_request(conn, pool, b)); - SVN_ERR(log_command(baton, conn, pool, "%s", - svn_log__get_location_segments(abs_path, peg_revision, - start_rev, end_rev, - pool))); - /* All the parameters are fine - let's perform the query against the * repository. */ @@ -2546,8 +2567,7 @@ static svn_error_t *get_location_segment write_err = svn_ra_svn__write_word(conn, pool, "done"); if (write_err) { - svn_error_clear(err); - return write_err; + return svn_error_compose_create(write_err, err); } SVN_CMD_ERR(err); @@ -2856,7 +2876,7 @@ static svn_error_t *lock_many(svn_ra_svn ¤t_rev); if (write_err) break; - + full_path = svn_fspath__join(b->repository->fs_path->data, svn_relpath_canonicalize(path, subpool), subpool); @@ -3296,6 +3316,7 @@ get_inherited_props(svn_ra_svn_conn_t *c int i; apr_pool_t *iterpool = svn_pool_create(pool); authz_baton_t ab; + svn_node_kind_t node_kind; ab.server = b; ab.conn = conn; @@ -3311,15 +3332,18 @@ get_inherited_props(svn_ra_svn_conn_t *c SVN_ERR(must_have_access(conn, iterpool, b, svn_authz_read, full_path, FALSE)); - if (!SVN_IS_VALID_REVNUM(rev)) - SVN_CMD_ERR(svn_fs_youngest_rev(&rev, b->repository->fs, pool)); - SVN_ERR(log_command(b, conn, pool, "%s", svn_log__get_inherited_props(full_path, rev, iterpool))); /* Fetch the properties and a stream for the contents. */ SVN_CMD_ERR(svn_fs_revision_root(&root, b->repository->fs, rev, iterpool)); + SVN_CMD_ERR(svn_fs_check_path(&node_kind, root, full_path, pool)); + if (node_kind == svn_node_none) + { + SVN_CMD_ERR(svn_error_createf(SVN_ERR_FS_NOT_FOUND, NULL, + _("'%s' path not found"), full_path)); + } SVN_CMD_ERR(get_props(NULL, &inherited_props, &ab, root, full_path, pool)); /* Send successful command response with revision and props. */ @@ -3755,7 +3779,7 @@ construct_server_baton(server_baton_t ** server_baton_t *b = apr_pcalloc(conn_pool, sizeof(*b)); fs_warning_baton_t *warn_baton; svn_stringbuf_t *cap_log = svn_stringbuf_create_empty(scratch_pool); - + b->repository = apr_pcalloc(conn_pool, sizeof(*b->repository)); b->repository->username_case = params->username_case; b->repository->base = params->base; @@ -3857,7 +3881,7 @@ construct_server_baton(server_baton_t ** err = handle_config_error(find_repos(client_url, params->root, b->vhost, b->read_only, params->cfg, b->repository, params->config_pool, - params->authz_pool, params->fs_config, + params->authz_pool, params->fs_config, conn_pool, scratch_pool), b); if (!err) Modified: subversion/branches/fsx-1.10/subversion/svnserve/server.h URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/svnserve/server.h?rev=1685464&r1=1685463&r2=1685464&view=diff ============================================================================== --- subversion/branches/fsx-1.10/subversion/svnserve/server.h (original) +++ subversion/branches/fsx-1.10/subversion/svnserve/server.h Sun Jun 14 20:58:10 2015 @@ -40,7 +40,7 @@ extern "C" { #include "private/svn_mutex.h" #include "private/svn_repos_private.h" #include "private/svn_subr_private.h" - + enum username_case_type { CASE_FORCE_UPPER, CASE_FORCE_LOWER, CASE_ASIS }; enum authn_type { UNAUTHENTICATED, AUTHENTICATED }; @@ -70,7 +70,7 @@ typedef struct repository_t { enum access_type auth_access; /* access granted to authenticated users */ enum access_type anon_access; /* access granted to annonymous users */ - + } repository_t; typedef struct client_info_t { @@ -186,7 +186,7 @@ typedef struct connection_t the new thread decrease it and when it reaches 0 the pool can be released. */ svn_atomic_t ref_count; - + } connection_t; /* Return a client_info_t structure allocated in POOL and initialize it Modified: subversion/branches/fsx-1.10/subversion/svnserve/svnserve.c URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/svnserve/svnserve.c?rev=1685464&r1=1685463&r2=1685464&view=diff ============================================================================== --- subversion/branches/fsx-1.10/subversion/svnserve/svnserve.c (original) +++ subversion/branches/fsx-1.10/subversion/svnserve/svnserve.c Sun Jun 14 20:58:10 2015 @@ -126,7 +126,7 @@ enum run_mode { * * Since very slow connections will hog a full thread for a potentially * long time before timing out, be sure to not set this limit too low. - * + * * On the other hand, keep in mind that every thread will allocate up to * 4MB of unused RAM in the APR allocator of its root pool. 32 bit servers * must hence do with fewer threads. @@ -150,7 +150,7 @@ enum run_mode { * * Larger values improve scalability with lots of small requests coming * on over long latency networks. - * + * * The OS may actually use a lower limit than specified here. */ #define ACCEPT_BACKLOG 128 @@ -475,7 +475,7 @@ static apr_status_t redirect_stdout(void /* Wait for the next client connection to come in from SOCK. Allocate * the connection in a root pool from CONNECTION_POOLS and assign PARAMS. * Return the connection object in *CONNECTION. - * + * * Use HANDLING_MODE for proper internal cleanup. */ static svn_error_t * @@ -486,30 +486,30 @@ accept_connection(connection_t **connect apr_pool_t *pool) { apr_status_t status; - + /* Non-standard pool handling. The main thread never blocks to join * the connection threads so it cannot clean up after each one. So * separate pools that can be cleared at thread exit are used. */ - + apr_pool_t *connection_pool = svn_pool_create(pool); *connection = apr_pcalloc(connection_pool, sizeof(**connection)); (*connection)->pool = connection_pool; (*connection)->params = params; (*connection)->ref_count = 1; - + do { #ifdef WIN32 if (winservice_is_stopping()) exit(0); #endif - + status = apr_socket_accept(&(*connection)->usock, sock, connection_pool); if (handling_mode == connection_mode_fork) { apr_proc_t proc; - + /* Collect any zombie child processes. */ while (apr_proc_wait_all_procs(&proc, NULL, NULL, APR_NOWAIT, connection_pool) == APR_CHILD_DONE) @@ -519,7 +519,7 @@ accept_connection(connection_t **connect while (APR_STATUS_IS_EINTR(status) || APR_STATUS_IS_ECONNABORTED(status) || APR_STATUS_IS_ECONNRESET(status)); - + return status ? svn_error_wrap_apr(status, _("Can't accept client connection")) : SVN_NO_ERROR; @@ -611,7 +611,7 @@ static void * APR_THREAD_FUNC serve_thre close_connection(connection); else apr_thread_pool_push(threads, serve_thread, connection, 0, NULL); - + return NULL; } @@ -983,7 +983,7 @@ sub_main(int *exit_code, int argc, const svn_hash_sets(params.fs_config, SVN_FS_CONFIG_FSFS_CACHE_REVPROPS, cache_revprops ? "2" :"0"); svn_hash_sets(params.fs_config, SVN_FS_CONFIG_FSFS_BLOCK_READ, - use_block_read ? "1" :"0"); + use_block_read ? "1" :"0"); SVN_ERR(svn_repos__config_pool_create(¶ms.config_pool, is_multi_threaded, @@ -1001,7 +1001,7 @@ sub_main(int *exit_code, int argc, const SVN_ERR(svn_repos__config_pool_get(¶ms.cfg, NULL, params.config_pool, - config_filename, + config_filename, TRUE, /* must_exist */ FALSE, /* names_case_sensitive */ NULL, Modified: subversion/branches/fsx-1.10/subversion/svnsync/svnsync.c URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/svnsync/svnsync.c?rev=1685464&r1=1685463&r2=1685464&view=diff ============================================================================== --- subversion/branches/fsx-1.10/subversion/svnsync/svnsync.c (original) +++ subversion/branches/fsx-1.10/subversion/svnsync/svnsync.c Sun Jun 14 20:58:10 2015 @@ -68,11 +68,8 @@ enum svnsync__opt { svnsync_opt_disable_locking, svnsync_opt_version, svnsync_opt_trust_server_cert, - svnsync_opt_trust_server_cert_unknown_ca, - svnsync_opt_trust_server_cert_cn_mismatch, - svnsync_opt_trust_server_cert_expired, - svnsync_opt_trust_server_cert_not_yet_valid, - svnsync_opt_trust_server_cert_other_failure, + svnsync_opt_trust_server_cert_failures_src, + svnsync_opt_trust_server_cert_failures_dst, svnsync_opt_allow_non_empty, svnsync_opt_steal_lock }; @@ -83,11 +80,8 @@ enum svnsync__opt { svnsync_opt_auth_username, \ svnsync_opt_auth_password, \ svnsync_opt_trust_server_cert, \ - svnsync_opt_trust_server_cert_unknown_ca, \ - svnsync_opt_trust_server_cert_cn_mismatch, \ - svnsync_opt_trust_server_cert_expired, \ - svnsync_opt_trust_server_cert_not_yet_valid, \ - svnsync_opt_trust_server_cert_other_failure, \ + svnsync_opt_trust_server_cert_failures_src, \ + svnsync_opt_trust_server_cert_failures_dst, \ svnsync_opt_source_username, \ svnsync_opt_source_password, \ svnsync_opt_sync_username, \ @@ -204,29 +198,37 @@ static const apr_getopt_option_t svnsync " " "see --source-password and --sync-password)") }, {"trust-server-cert", svnsync_opt_trust_server_cert, 0, - N_("deprecated; same as --trust-unknown-ca")}, - {"trust-unknown-ca", svnsync_opt_trust_server_cert_unknown_ca, 0, - N_("with --non-interactive, accept SSL server\n" + N_("deprecated; same as\n" " " - "certificates from unknown certificate authorities")}, - {"trust-cn-mismatch", svnsync_opt_trust_server_cert_cn_mismatch, 0, - N_("with --non-interactive, accept SSL server\n" + "--source-trust-server-cert-failures=unknown-ca\n" " " - "certificates even if the server hostname does not\n" + "--sync-trust-server-cert-failures=unknown-ca")}, + {"source-trust-server-cert-failures", svnsync_opt_trust_server_cert_failures_src, 1, + N_("with --non-interactive, accept SSL\n" " " - "match the certificate's common name attribute")}, - {"trust-expired", svnsync_opt_trust_server_cert_expired, 0, - N_("with --non-interactive, accept expired SSL server\n" + "server certificates with failures.\n" " " - "certificates")}, - {"trust-not-yet-valid", svnsync_opt_trust_server_cert_not_yet_valid, 0, - N_("with --non-interactive, accept SSL server\n" + "ARG is a comma-separated list of:\n" " " - "certificates from the future")}, - {"trust-other-failure", svnsync_opt_trust_server_cert_other_failure, 0, - N_("with --non-interactive, accept SSL server\n" + "- 'unknown-ca' (Unknown Authority)\n" " " - "certificates with failures other than the above")}, + "- 'cn-mismatch' (Hostname mismatch)\n" + " " + "- 'expired' (Expired certificate)\n" + " " + "- 'not-yet-valid' (Not yet valid certificate)\n" + " " + "- 'other' (all other not separately classified\n" + " " + " certificate errors).\n" + " " + "Applied to the source URL.")}, + {"sync-trust-server-cert-failures", svnsync_opt_trust_server_cert_failures_dst, 1, + N_("Like\n" + " " + "--source-trust-server-cert-failures,\n" + " " + "but applied to the destination URL.")}, {"source-username", svnsync_opt_source_username, 1, N_("connect to source repository with username ARG") }, {"source-password", svnsync_opt_source_password, 1, @@ -280,11 +282,13 @@ static const apr_getopt_option_t svnsync typedef struct opt_baton_t { svn_boolean_t non_interactive; - svn_boolean_t trust_server_cert_unknown_ca; - svn_boolean_t trust_server_cert_cn_mismatch; - svn_boolean_t trust_server_cert_expired; - svn_boolean_t trust_server_cert_not_yet_valid; - svn_boolean_t trust_server_cert_other_failure; + struct { + svn_boolean_t trust_server_cert_unknown_ca; + svn_boolean_t trust_server_cert_cn_mismatch; + svn_boolean_t trust_server_cert_expired; + svn_boolean_t trust_server_cert_not_yet_valid; + svn_boolean_t trust_server_cert_other_failure; + } src_trust, dst_trust; svn_boolean_t no_auth_cache; svn_auth_baton_t *source_auth_baton; svn_auth_baton_t *sync_auth_baton; @@ -2008,24 +2012,30 @@ sub_main(int *exit_code, int argc, const break; case svnsync_opt_trust_server_cert: /* backwards compat */ - case svnsync_opt_trust_server_cert_unknown_ca: - opt_baton.trust_server_cert_unknown_ca = TRUE; - break; - - case svnsync_opt_trust_server_cert_cn_mismatch: - opt_baton.trust_server_cert_cn_mismatch = TRUE; - break; - - case svnsync_opt_trust_server_cert_expired: - opt_baton.trust_server_cert_expired = TRUE; + opt_baton.src_trust.trust_server_cert_unknown_ca = TRUE; + opt_baton.dst_trust.trust_server_cert_unknown_ca = TRUE; break; - case svnsync_opt_trust_server_cert_not_yet_valid: - opt_baton.trust_server_cert_not_yet_valid = TRUE; + case svnsync_opt_trust_server_cert_failures_src: + SVN_ERR(svn_utf_cstring_to_utf8(&opt_arg, opt_arg, pool)); + SVN_ERR(svn_cmdline__parse_trust_options( + &opt_baton.src_trust.trust_server_cert_unknown_ca, + &opt_baton.src_trust.trust_server_cert_cn_mismatch, + &opt_baton.src_trust.trust_server_cert_expired, + &opt_baton.src_trust.trust_server_cert_not_yet_valid, + &opt_baton.src_trust.trust_server_cert_other_failure, + opt_arg, pool)); break; - case svnsync_opt_trust_server_cert_other_failure: - opt_baton.trust_server_cert_other_failure = TRUE; + case svnsync_opt_trust_server_cert_failures_dst: + SVN_ERR(svn_utf_cstring_to_utf8(&opt_arg, opt_arg, pool)); + SVN_ERR(svn_cmdline__parse_trust_options( + &opt_baton.dst_trust.trust_server_cert_unknown_ca, + &opt_baton.dst_trust.trust_server_cert_cn_mismatch, + &opt_baton.dst_trust.trust_server_cert_expired, + &opt_baton.dst_trust.trust_server_cert_not_yet_valid, + &opt_baton.dst_trust.trust_server_cert_other_failure, + opt_arg, pool)); break; case svnsync_opt_no_auth_cache: @@ -2073,7 +2083,8 @@ sub_main(int *exit_code, int argc, const SVN_ERR(svn_utf_cstring_to_utf8(&opt_arg, opt_arg, pool)); SVN_ERR(svn_cmdline__parse_config_option(config_options, - opt_arg, pool)); + opt_arg, "svnsync: ", + pool)); break; case svnsync_opt_source_prop_encoding: @@ -2139,6 +2150,7 @@ sub_main(int *exit_code, int argc, const apr_psprintf(pool, "config:miscellany:memory-cache-size=%s", opt_arg), + NULL /* won't be used */, pool)); break; @@ -2214,25 +2226,20 @@ sub_main(int *exit_code, int argc, const /* --trust-* can only be used with --non-interactive */ if (!opt_baton.non_interactive) { - if (opt_baton.trust_server_cert_unknown_ca) - return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL, - _("--trust-unknown-ca requires " - "--non-interactive")); - if (opt_baton.trust_server_cert_cn_mismatch) - return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL, - _("--trust-cn-mismatch requires " - "--non-interactive")); - if (opt_baton.trust_server_cert_expired) - return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL, - _("--trust-expired requires " - "--non-interactive")); - if (opt_baton.trust_server_cert_not_yet_valid) - return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL, - _("--trust-not-yet-valid requires " - "--non-interactive")); - if (opt_baton.trust_server_cert_other_failure) + if (opt_baton.src_trust.trust_server_cert_unknown_ca + || opt_baton.src_trust.trust_server_cert_cn_mismatch + || opt_baton.src_trust.trust_server_cert_expired + || opt_baton.src_trust.trust_server_cert_not_yet_valid + || opt_baton.src_trust.trust_server_cert_other_failure + || opt_baton.dst_trust.trust_server_cert_unknown_ca + || opt_baton.dst_trust.trust_server_cert_cn_mismatch + || opt_baton.dst_trust.trust_server_cert_expired + || opt_baton.dst_trust.trust_server_cert_not_yet_valid + || opt_baton.dst_trust.trust_server_cert_other_failure) return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL, - _("--trust-other-failure requires " + _("--source-trust-server-cert-failures " + "and " + "--sync-trust-server-cert-failures require " "--non-interactive")); } @@ -2352,11 +2359,11 @@ sub_main(int *exit_code, int argc, const opt_baton.source_password, opt_baton.config_dir, opt_baton.no_auth_cache, - opt_baton.trust_server_cert_unknown_ca, - opt_baton.trust_server_cert_cn_mismatch, - opt_baton.trust_server_cert_expired, - opt_baton.trust_server_cert_not_yet_valid, - opt_baton.trust_server_cert_other_failure, + opt_baton.src_trust.trust_server_cert_unknown_ca, + opt_baton.src_trust.trust_server_cert_cn_mismatch, + opt_baton.src_trust.trust_server_cert_expired, + opt_baton.src_trust.trust_server_cert_not_yet_valid, + opt_baton.src_trust.trust_server_cert_other_failure, config, check_cancel, NULL, pool); @@ -2368,11 +2375,11 @@ sub_main(int *exit_code, int argc, const opt_baton.sync_password, opt_baton.config_dir, opt_baton.no_auth_cache, - opt_baton.trust_server_cert_unknown_ca, - opt_baton.trust_server_cert_cn_mismatch, - opt_baton.trust_server_cert_expired, - opt_baton.trust_server_cert_not_yet_valid, - opt_baton.trust_server_cert_other_failure, + opt_baton.dst_trust.trust_server_cert_unknown_ca, + opt_baton.dst_trust.trust_server_cert_cn_mismatch, + opt_baton.dst_trust.trust_server_cert_expired, + opt_baton.dst_trust.trust_server_cert_not_yet_valid, + opt_baton.dst_trust.trust_server_cert_other_failure, config, check_cancel, NULL, pool); Modified: subversion/branches/fsx-1.10/subversion/tests/cmdline/README URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/tests/cmdline/README?rev=1685464&r1=1685463&r2=1685464&view=diff ============================================================================== --- subversion/branches/fsx-1.10/subversion/tests/cmdline/README (original) +++ subversion/branches/fsx-1.10/subversion/tests/cmdline/README Sun Jun 14 20:58:10 2015 @@ -180,8 +180,8 @@ or if you're running an individual test, $ ./basic_tests.py --url=svn://localhost --enable-sasl 3 -Note that to do this you'll have to have a subversion.conf file in your -SASL lib dir (i.e. something like /usr/lib/sasl2/subversion.conf), it +Note that to do this you'll have to have a svn.conf file in your +SASL lib dir (i.e. something like /usr/lib/sasl2/svn.conf), it should contain something like: pwcheck_method: auxprop @@ -195,6 +195,16 @@ $ saslpasswd2 -c -u svntest jconstant As usual, both users should use the password 'rayjandom'. +To enable DUMP_LOAD_CROSS_CHECK to work a third user is required, + +$ saslpasswd2 -c -u svntest __dumpster__ + +with password '__loadster__'. + +The user running the tests will need read access to the sasl database +and on some systems this can be arranged by adding the user to the sasl +group. + There are 'make svnserveautocheck' and ./svnserveautocheck.sh commands, analogous to davautocheck.sh documented above. Modified: subversion/branches/fsx-1.10/subversion/tests/cmdline/atomic-ra-revprop-change.c URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/tests/cmdline/atomic-ra-revprop-change.c?rev=1685464&r1=1685463&r2=1685464&view=diff ============================================================================== --- subversion/branches/fsx-1.10/subversion/tests/cmdline/atomic-ra-revprop-change.c (original) +++ subversion/branches/fsx-1.10/subversion/tests/cmdline/atomic-ra-revprop-change.c Sun Jun 14 20:58:10 2015 @@ -58,13 +58,14 @@ construct_auth_baton(svn_auth_baton_t ** const char *config_dir, apr_pool_t *pool) { - SVN_ERR(svn_cmdline_create_auth_baton(auth_baton_p, - TRUE /* non_interactive */, - "jrandom", "rayjandom", - config_dir, - TRUE /* no_auth_cache */, - FALSE /* trust_server_cert */, - NULL, NULL, NULL, pool)); + SVN_ERR(svn_cmdline_create_auth_baton2(auth_baton_p, + TRUE /* non_interactive */, + "jrandom", "rayjandom", + config_dir, + TRUE /* no_auth_cache */, + FALSE /* trust_server_cert */, + FALSE, FALSE, FALSE, FALSE, + NULL, NULL, NULL, pool)); return SVN_NO_ERROR; } Modified: subversion/branches/fsx-1.10/subversion/tests/cmdline/authz_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/tests/cmdline/authz_tests.py?rev=1685464&r1=1685463&r2=1685464&view=diff ============================================================================== --- subversion/branches/fsx-1.10/subversion/tests/cmdline/authz_tests.py (original) +++ subversion/branches/fsx-1.10/subversion/tests/cmdline/authz_tests.py Sun Jun 14 20:58:10 2015 @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# authz_tests.py: testing authentication. +# authz_tests.py: testing authorization. # # Subversion is a tool for revision control. # See http://subversion.apache.org for more information. @@ -83,7 +83,7 @@ def authz_open_root(sbox): svntest.actions.run_and_verify_commit(wc_dir, expected_output, None, - None, + [], mu_path) #---------------------------------------------------------------------- @@ -119,9 +119,7 @@ def authz_open_directory(sbox): # Commit the working copy. svntest.actions.run_and_verify_commit(wc_dir, expected_output, - None, - None, - wc_dir) + None) @Skip(svntest.main.is_ra_type_file) @SkipDumpLoadCrossCheck() @@ -392,9 +390,9 @@ def authz_checkout_test(sbox): expected_wc = svntest.main.greek_state svntest.actions.run_and_verify_checkout(sbox.repo_url, - local_dir, - expected_output, - expected_wc) + local_dir, + expected_output, + expected_wc) @Skip(svntest.main.is_ra_type_file) def authz_checkout_and_update_test(sbox): @@ -456,9 +454,7 @@ def authz_checkout_and_update_test(sbox) expected_output, expected_wc, expected_status, - None, - None, None, - None, None, 1) + [], True) @Skip(svntest.main.is_ra_type_file) def authz_partial_export_test(sbox): @@ -770,7 +766,7 @@ def authz_locking(sbox): svntest.actions.run_and_verify_commit(wc_dir, expected_output, [], - None, + [], mu_path) # Lock two paths one of which fails. First add read access to '/' so @@ -1135,7 +1131,7 @@ def case_sensitive_authz(sbox): }) # error messages - expected_error_for_commit = "Commit failed" + expected_error_for_commit = ".*Commit failed.*" if sbox.repo_url.startswith("http"): expected_error_for_cat = ".*[Ff]orbidden.*" @@ -1204,7 +1200,7 @@ def case_sensitive_authz(sbox): svntest.actions.run_and_verify_commit(wc_dir, expected_output, None, - None, + [], mu_path) @Skip(svntest.main.is_ra_type_file) @@ -1233,7 +1229,7 @@ def authz_tree_conflict(sbox): expected_output, None, expected_status, - None, None, None, None, None, 0, + [], False, '-r', '1', wc_dir) @Issue(3900) @@ -1432,9 +1428,7 @@ def remove_subdir_with_authz_and_tc(sbox expected_output, None, expected_status, - None, - None, None, - None, None, False, + [], False, wc_dir, '-r', '1') # Perform some edit operation to introduce a tree conflict @@ -1449,11 +1443,7 @@ def remove_subdir_with_authz_and_tc(sbox svntest.actions.run_and_verify_update(wc_dir, expected_output, None, - None, - None, - None, None, - None, None, False, - wc_dir) + None) @SkipUnless(svntest.main.is_ra_type_svn) def authz_svnserve_groups(sbox): Modified: subversion/branches/fsx-1.10/subversion/tests/cmdline/basic_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/tests/cmdline/basic_tests.py?rev=1685464&r1=1685463&r2=1685464&view=diff ============================================================================== --- subversion/branches/fsx-1.10/subversion/tests/cmdline/basic_tests.py (original) +++ subversion/branches/fsx-1.10/subversion/tests/cmdline/basic_tests.py Sun Jun 14 20:58:10 2015 @@ -140,9 +140,7 @@ def basic_commit(sbox): svntest.actions.run_and_verify_commit(wc_dir, expected_output, - expected_status, - None, - wc_dir) + expected_status) #---------------------------------------------------------------------- @@ -176,7 +174,7 @@ def basic_update(sbox): # Commit. svntest.actions.run_and_verify_commit(wc_dir, expected_output, - expected_status, None, wc_dir) + expected_status) # Create expected output tree for an update of the wc_backup. expected_output = wc.State(wc_backup, { @@ -406,8 +404,7 @@ def basic_commit_corruption(sbox): # This commit should fail due to text base corruption. svntest.actions.run_and_verify_commit(wc_dir, expected_output, None, # expected_status, - "svn: E200014: Checksum", - wc_dir) + "svn: E200014: Checksum") # Restore the uncorrupted text base. os.chmod(tb_dir_path, 0777) @@ -419,7 +416,7 @@ def basic_commit_corruption(sbox): # This commit should succeed. svntest.actions.run_and_verify_commit(wc_dir, expected_output, - expected_status, None, wc_dir) + expected_status) #---------------------------------------------------------------------- def basic_update_corruption(sbox): @@ -463,7 +460,7 @@ def basic_update_corruption(sbox): # This commit should succeed. svntest.actions.run_and_verify_commit(wc_dir, expected_output, - expected_status, None, wc_dir) + expected_status) # Create expected output tree for an update of the other_wc. expected_output = wc.State(other_wc, { @@ -499,7 +496,7 @@ def basic_update_corruption(sbox): fail_output, expected_disk, fail_status, - "svn: E155017: Checksum", other_wc) + "svn: E155017: Checksum") # Restore the uncorrupted text base. os.chmod(tb_dir_path, 0777) @@ -556,7 +553,7 @@ def basic_merging_update(sbox): svntest.actions.run_and_verify_commit(wc_dir, expected_output, expected_status, - None, + [], wc_dir) # Make a backup copy of the working copy @@ -582,7 +579,7 @@ def basic_merging_update(sbox): svntest.actions.run_and_verify_commit(wc_dir, expected_output, expected_status, - None, + [], wc_dir) # Make local mods to wc_backup by recreating mu and rho @@ -663,7 +660,7 @@ def basic_conflict(sbox): # Commit. svntest.actions.run_and_verify_commit(wc_dir, expected_output, - expected_status, None, wc_dir) + expected_status) # Create expected output tree for an update of the wc_backup. expected_output = wc.State(wc_backup, { @@ -707,9 +704,7 @@ def basic_conflict(sbox): expected_output, expected_disk, expected_status, - None, - svntest.tree.detect_conflict_files, - extra_files) + extra_files=extra_files) # verify that the extra_files list is now empty. if len(extra_files) != 0: @@ -977,7 +972,7 @@ def basic_switch(sbox): expected_output, expected_disk, expected_status, - None, None, None, None, None, + [], False, '--ignore-ancestry') ### Switch the directory `A/D/H' to `A/D/G'. @@ -1037,7 +1032,7 @@ def basic_switch(sbox): expected_output, expected_disk, expected_status, - None, None, None, None, None, + [], False, '--ignore-ancestry') #---------------------------------------------------------------------- @@ -1290,8 +1285,7 @@ def basic_checkout_deleted(sbox): 'A/D/gamma') svntest.actions.run_and_verify_commit(wc_dir, - expected_output, expected_status, - None, wc_dir) + expected_output, expected_status) # Now try to checkout revision 1 of A/D. url = sbox.repo_url + '/A/D' @@ -1333,8 +1327,7 @@ def basic_node_kind_change(sbox): expected_status = svntest.actions.get_virginal_state(wc_dir, 1) expected_status.tweak('A/D/gamma', status=' ', wc_rev='2') svntest.actions.run_and_verify_commit(wc_dir, - expected_output, expected_status, - None, wc_dir) + expected_output, expected_status) # Try and fail to create a directory (file deleted) svntest.actions.run_and_verify_svn(None, svntest.verify.AnyOutput, @@ -1412,8 +1405,7 @@ def basic_import(sbox): expected_output, expected_disk, expected_status, - None, None, None, - None, None, 1) + [], True) #---------------------------------------------------------------------- @@ -1679,9 +1671,7 @@ def basic_add_parents(sbox): # Commit and verify svntest.actions.run_and_verify_commit(wc_dir, expected_output, - expected_status, - None, - wc_dir) + expected_status) svntest.actions.run_and_verify_svn(None, [], 'rm', X_path, '--keep-local') @@ -1850,9 +1840,7 @@ def info_nonhead(sbox): expected_status.remove("iota") svntest.actions.run_and_verify_commit(wc_dir, expected_output, - expected_status, - None, - wc_dir) + expected_status) # Get info for old iota at r1. expected_infos = [ { 'URL' : '.*' }, @@ -1881,8 +1869,7 @@ def ls_nonhead(sbox): expected_status.remove('A/D/G', 'A/D/G/rho', 'A/D/G/pi', 'A/D/G/tau',) svntest.actions.run_and_verify_commit(wc_dir, - expected_output, expected_status, - None, wc_dir) + expected_output, expected_status) # Check that we can list a file in A/D/G at revision 1. rho_url = sbox.repo_url + "/A/D/G/rho" @@ -1949,9 +1936,7 @@ def delete_keep_local(sbox): svntest.actions.run_and_verify_commit(wc_dir, expected_output, - expected_status, - None, - wc_dir) + expected_status) # Update working copy to check disk state still greek tree expected_disk = svntest.main.greek_state.copy() @@ -2206,7 +2191,7 @@ def automatic_conflict_resolution(sbox): # Commit. svntest.actions.run_and_verify_commit(wc_dir, expected_output, - expected_status, None, wc_dir) + expected_status) # Create expected output tree for an update of the wc_backup. expected_output = wc.State(wc_backup, { @@ -2285,21 +2270,7 @@ def automatic_conflict_resolution(sbox): expected_output, expected_disk, expected_status, - None, - svntest.tree.detect_conflict_files, - extra_files) - - # verify that the extra_files list is now empty. - if len(extra_files) != 0: - # Because we want to be a well-behaved test, we silently raise if - # the test fails. However, these two print statements would - # probably reveal the cause for the failure, if they were - # uncommented: - # - # logger.warn("Not all extra reject files have been accounted for:") - # logger.warn(extra_files) - ### we should raise a less generic error here. which? - raise svntest.Failure + extra_files=extra_files) # So now lambda, mu and rho are all in a "conflicted" state. Run 'svn # resolve' with the respective "--accept[mine|orig|repo]" flag. @@ -2387,9 +2358,7 @@ def automatic_conflict_resolution(sbox): expected_output, expected_disk, expected_status, - None, - svntest.tree.detect_conflict_files, - extra_files) + extra_files=extra_files) def info_nonexisting_file(sbox): "get info on a file not in the repo" @@ -2687,9 +2656,7 @@ def delete_and_add_same_file(sbox): # not found". svntest.actions.run_and_verify_commit(wc_dir, expected_output, - expected_status, - None, - wc_dir) + expected_status) def delete_child_parent_update(sbox): "rm child, commit, rm parent" @@ -2708,9 +2675,7 @@ def delete_child_parent_update(sbox): svntest.actions.run_and_verify_commit(wc_dir, expected_output, - expected_status, - None, - wc_dir) + expected_status) svntest.main.run_svn(wc_dir, 'rm', sbox.ospath('A/B/E')) expected_status.tweak('A/B/E', 'A/B/E/beta', status='D ') @@ -3083,32 +3048,6 @@ def peg_rev_on_non_existent_wc_path(sbox 'cat', '-r2', sbox.ospath('mu3') + '@3') -@Issue(4299) -def basic_youngest(sbox): - 'basic youngest' - - sbox.build(read_only=True) - - repos_url = sbox.repo_url - deep_repos_url = repos_url + '/A/D/G' - - wc_dir = sbox.wc_dir - deep_wc_dir = os.path.join(wc_dir, 'A', 'B', 'E', 'alpha') - bad_wc_dir = os.path.join(wc_dir, 'Z') - - svntest.actions.run_and_verify_svn(None, svntest.verify.AnyOutput, - 'youngest', bad_wc_dir) - - for flag, output in [(False, "1\n"), (True, "1")]: - for path in [repos_url, deep_repos_url, wc_dir, deep_wc_dir]: - if flag: - svntest.actions.run_and_verify_svn([output], [], - 'youngest', '--no-newline', path) - else: - svntest.actions.run_and_verify_svn([output], [], - 'youngest', path) - - # With 'svn mkdir --parents' the target directory may already exist on disk. # In that case it was wrongly performing a recursive 'add' on its contents. def mkdir_parents_target_exists_on_disk(sbox): @@ -3134,6 +3073,48 @@ def mkdir_parents_target_exists_on_disk( svntest.actions.run_and_verify_status(wc_dir, expected_status) +@Skip(svntest.main.is_ra_type_file) +def plaintext_password_storage_disabled(sbox): + "test store-plaintext-passwords = no" + + sbox.build() + + wc_dir = sbox.wc_dir + sbox.simple_append("iota", "New content for iota.") + + config_dir_path = sbox.get_tempname(prefix="config-dir") + os.mkdir(config_dir_path) + + # disable all encryped password stores + config_file = file(os.path.join(config_dir_path, "config"), "w") + config_file.write("[auth]\npassword-stores =\n") + config_file.close() + + # disable plaintext password storage + servers_file = file(os.path.join(config_dir_path, "servers"), "w") + servers_file.write("[global]\nstore-plaintext-passwords=no\n") + servers_file.close() + + svntest.main.run_command(svntest.main.svn_binary, False, False, + "commit", "--config-dir", config_dir_path, + "-m", "committing with plaintext password storage disabled", + "--username", svntest.main.wc_author, + "--password", svntest.main.wc_passwd, + "--trust-server-cert-failures", "unknown-ca", + "--non-interactive", wc_dir) + + # Verify that the password was not stored in plaintext + for root, dirs, files, in os.walk(os.path.join(config_dir_path, "auth")): + for file_name in files: + path = os.path.join(root, file_name) + f = file(path, "r") + for line in f.readlines(): + if svntest.main.wc_passwd in line: + f.close() + raise svntest.Failure("password was found in '%s'" % path) + f.close() + + ######################################################################## # Run the tests @@ -3202,8 +3183,8 @@ test_list = [ None, rm_missing_with_case_clashing_ondisk_item, delete_conflicts_one_of_many, peg_rev_on_non_existent_wc_path, - basic_youngest, mkdir_parents_target_exists_on_disk, + plaintext_password_storage_disabled, ] if __name__ == '__main__': Modified: subversion/branches/fsx-1.10/subversion/tests/cmdline/blame_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/tests/cmdline/blame_tests.py?rev=1685464&r1=1685463&r2=1685464&view=diff ============================================================================== --- subversion/branches/fsx-1.10/subversion/tests/cmdline/blame_tests.py (original) +++ subversion/branches/fsx-1.10/subversion/tests/cmdline/blame_tests.py Sun Jun 14 20:58:10 2015 @@ -213,7 +213,7 @@ def blame_in_xml(sbox): 'iota' : Item(verb='Sending'), }) svntest.actions.run_and_verify_commit(wc_dir, expected_output, - None, None, wc_dir) + None) # Retrieve last changed date from svn info exit_code, output, error = svntest.actions.run_and_verify_svn( @@ -284,7 +284,7 @@ def blame_on_unknown_revision(sbox): 'iota' : Item(verb='Sending'), }) svntest.actions.run_and_verify_commit(wc_dir, expected_output, - None, None, wc_dir) + None) exit_code, output, error = svntest.actions.run_and_verify_svn( None, [], @@ -355,13 +355,13 @@ def blame_eol_styles(sbox): for i in range(1,3): svntest.main.file_append(file_path, "Extra line %d" % (i) + "\n") svntest.actions.run_and_verify_commit(wc_dir, expected_output, - None, None, wc_dir) + None) svntest.main.run_svn(None, 'propset', 'svn:eol-style', eol, file_path) svntest.actions.run_and_verify_commit(wc_dir, expected_output, - None, None, wc_dir) + None) exit_code, output, error = svntest.actions.run_and_verify_svn( None, [], @@ -389,7 +389,7 @@ def blame_ignore_whitespace(sbox): 'iota' : Item(verb='Sending'), }) svntest.actions.run_and_verify_commit(wc_dir, expected_output, - None, None, wc_dir) + None) # commit only whitespace changes svntest.main.file_write(file_path, @@ -400,7 +400,7 @@ def blame_ignore_whitespace(sbox): 'iota' : Item(verb='Sending'), }) svntest.actions.run_and_verify_commit(wc_dir, expected_output, - None, None, wc_dir) + None) # match the blame output, as defined in the blame code: # "%6ld %10s %s %s%s", rev, author ? author : " -", @@ -425,7 +425,7 @@ def blame_ignore_whitespace(sbox): 'iota' : Item(verb='Sending'), }) svntest.actions.run_and_verify_commit(wc_dir, expected_output, - None, None, wc_dir) + None) expected_output = [ " 2 jrandom A a \n", @@ -454,7 +454,7 @@ def blame_ignore_eolstyle(sbox): 'iota' : Item(verb='Sending'), }) svntest.actions.run_and_verify_commit(wc_dir, expected_output, - None, None, wc_dir) + None) # commit only eol changes svntest.main.file_write(file_path, @@ -465,7 +465,7 @@ def blame_ignore_eolstyle(sbox): 'iota' : Item(verb='Sending'), }) svntest.actions.run_and_verify_commit(wc_dir, expected_output, - None, None, wc_dir) + None) expected_output = [ " 2 jrandom Aa\n", @@ -652,7 +652,7 @@ def blame_output_after_merge(sbox): 'trunk/A/mu' : Item(verb='Sending'), }) svntest.actions.run_and_verify_commit(wc_dir, expected_output, - None, None, wc_dir) + None) # r4: create branches/br from trunk branches_br_url = sbox.repo_url + "/branches/br" @@ -678,7 +678,7 @@ def blame_output_after_merge(sbox): 'branches/br/A/mu' : Item(verb='Sending'), }) svntest.actions.run_and_verify_commit(wc_dir, expected_output, - None, None, wc_dir) + None) # r6: Insert a single line in branches/A/mu svntest.main.file_write(branch_mu_path, @@ -694,7 +694,7 @@ def blame_output_after_merge(sbox): 'branches/br/A/mu' : Item(verb='Sending'), }) svntest.actions.run_and_verify_commit(wc_dir, expected_output, - None, None, wc_dir) + None) # r7: merge branches/br back to trunk trunk_path = os.path.join(wc_dir, "trunk") @@ -706,7 +706,7 @@ def blame_output_after_merge(sbox): 'trunk/A/mu' : Item(verb='Sending'), }) svntest.actions.run_and_verify_commit(wc_dir, expected_output, - None, None, wc_dir) + None) # Now test blame, first without the -g option expected_output = [ " 3 jrandom New version of file 'mu'.\n", @@ -748,7 +748,7 @@ def blame_output_after_merge(sbox): # Next test with the -g option with -rN:M expected_output = [ " - - New version of file 'mu'.\n", " - - 2nd line in file 'mu'.\n", - "G - - new 3rd line in file 'mu'.\n", + "G 5 jrandom new 3rd line in file 'mu'.\n", "G 6 jrandom add 3.5 line in file 'mu'.\n", " - - 4th line in file 'mu'.\n", " - - 5th line in file 'mu'.\n", @@ -950,23 +950,115 @@ def blame_youngest_to_oldest(sbox): orig_line = open(iota).read() line = "New contents for iota\n" svntest.main.file_append(iota, line) - sbox.simple_commit() - + sbox.simple_commit() #r2 + # Move the file, to check that the operation will peg correctly. iota_moved = sbox.ospath('iota_moved') sbox.simple_move('iota', 'iota_moved') - sbox.simple_commit() - + sbox.simple_commit() #r3 + # Delete a line. open(iota_moved, 'w').write(line) - sbox.simple_commit() + sbox.simple_commit() #r4 expected_output = [ - ' %d jrandom %s\n' % (3, orig_line[:-1]), + ' %d jrandom %s\n' % (4, orig_line[:-1]), ] svntest.actions.run_and_verify_svn(expected_output, [], 'blame', '-r4:1', iota_moved) + svntest.actions.run_and_verify_svn(expected_output, [], + 'blame', '-rHEAD:1', iota_moved) + + expected_output = [ + ' %d jrandom %s\n' % (2, line[:-1]), + ] + svntest.actions.run_and_verify_svn(expected_output, [], + 'blame', '-r1:HEAD', iota_moved) + +@Issue(4467) +def blame_reverse_no_change(sbox): + "blame reverse towards a revision with no change" + + sbox.build() + + # Introduce a revision where iota doesn't change! + sbox.simple_propset('a', 'b', 'A') + sbox.simple_commit('') #r2 + + sbox.simple_append('iota', 'new line\n') + sbox.simple_commit('') #r3 + + sbox.simple_append('iota', 'another new line\n') + sbox.simple_commit('') #r4 + + expected_output = [ + ' - - This is the file \'iota\'.\n', + ' 3 jrandom new line\n', + ' 4 jrandom another new line\n', + ] + svntest.actions.run_and_verify_svn(expected_output, [], + 'blame', '-r2:HEAD', sbox.ospath('iota')) + + expected_output = [ + ' - - This is the file \'iota\'.\n', + ] + # This used to trigger an assertion on 1.9.x before 1.9.0 + svntest.actions.run_and_verify_svn(expected_output, [], + 'blame', '-rHEAD:2', sbox.ospath('iota')) + + # Drop the middle line + sbox.simple_append('iota', 'This is the file \'iota\'.\n' + 'another new line\n', truncate=True) + sbox.simple_commit('') #r5 + + # Back to start + sbox.simple_append('iota', 'This is the file \'iota\'.\n', truncate=True) + sbox.simple_commit('') #r6 + + expected_output = [ + ' - - This is the file \'iota\'.\n', + ] + svntest.actions.run_and_verify_svn(expected_output, [], + 'blame', '-rHEAD:2', sbox.ospath('iota')) + + expected_output = [ + ' - - This is the file \'iota\'.\n', + ' 5 jrandom new line\n', + ] + svntest.actions.run_and_verify_svn(expected_output, [], + 'blame', '-rHEAD:3', sbox.ospath('iota')) + + expected_output = [ + ' - - This is the file \'iota\'.\n', + ' 5 jrandom new line\n', + ' 6 jrandom another new line\n', + ] + svntest.actions.run_and_verify_svn(expected_output, [], + 'blame', '-rHEAD:4', sbox.ospath('iota')) + + expected_output = [ + ' - - This is the file \'iota\'.\n', + ' 6 jrandom another new line\n', + ] + svntest.actions.run_and_verify_svn(expected_output, [], + 'blame', '-rHEAD:5', sbox.ospath('iota')) + + expected_output = [ + ' - - This is the file \'iota\'.\n', + ] + svntest.actions.run_and_verify_svn(expected_output, [], + 'blame', '-rHEAD:6', sbox.ospath('iota')) + + + expected_output = [ + ' - - This is the file \'iota\'.\n', + ' 5 jrandom new line\n', + ] + svntest.actions.run_and_verify_svn(expected_output, [], + 'blame', '-r5:3', sbox.ospath('iota')) + + ######################################################################## # Run the tests @@ -991,6 +1083,7 @@ test_list = [ None, blame_multiple_targets, blame_eol_handling, blame_youngest_to_oldest, + blame_reverse_no_change, ] if __name__ == '__main__': Modified: subversion/branches/fsx-1.10/subversion/tests/cmdline/changelist_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/tests/cmdline/changelist_tests.py?rev=1685464&r1=1685463&r2=1685464&view=diff ============================================================================== --- subversion/branches/fsx-1.10/subversion/tests/cmdline/changelist_tests.py (original) +++ subversion/branches/fsx-1.10/subversion/tests/cmdline/changelist_tests.py Sun Jun 14 20:58:10 2015 @@ -442,7 +442,7 @@ def commit_one_changelist(sbox): svntest.actions.run_and_verify_commit(wc_dir, expected_output, expected_status, - None, + [], wc_dir, "--changelist", "a") @@ -483,7 +483,7 @@ def commit_multiple_changelists(sbox): svntest.actions.run_and_verify_commit(wc_dir, expected_output, expected_status, - None, + [], wc_dir, "--changelist", "a", "--changelist", "i") @@ -814,8 +814,7 @@ def update_with_changelists(sbox): expected_output, expected_disk, expected_status, - None, None, None, - None, None, 1, + [], True, "-r", "1", "--changelist", "a", "--changelist", "i", @@ -856,8 +855,7 @@ def update_with_changelists(sbox): expected_output, expected_disk, expected_status, - None, None, None, - None, None, 1, + [], True, "-r", "1", "--changelist", "a", "--changelist", "i", @@ -907,7 +905,7 @@ def tree_conflicts_and_changelists_on_co svntest.actions.run_and_verify_commit(wc_dir, expected_output, expected_status, - None, + [], wc_dir, "--changelist", "list") @@ -980,7 +978,7 @@ def tree_conflicts_and_changelists_on_co svntest.actions.run_and_verify_commit(wc_dir, expected_output, expected_status, - None, + [], wc_dir, "--changelist", "list")
