You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2011/08/04 23:55:54 UTC

svn commit: r1154028 - in /subversion/branches/1.7.x: ./ STATUS subversion/svnrdump/svnrdump.c

Author: hwright
Date: Thu Aug  4 21:55:53 2011
New Revision: 1154028

URL: http://svn.apache.org/viewvc?rev=1154028&view=rev
Log:
Merge r1153968 from trunk:

 * r1153968
   Add --trust-server-cert option to svnrdump, too.
   Justification:
     Consistency with our other network tools.
   Votes:
     +1: cmpilato, gstein, hwright
     +0: danielsh

Modified:
    subversion/branches/1.7.x/   (props changed)
    subversion/branches/1.7.x/STATUS
    subversion/branches/1.7.x/subversion/svnrdump/svnrdump.c

Propchange: subversion/branches/1.7.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Aug  4 21:55:53 2011
@@ -54,4 +54,4 @@
 /subversion/branches/tree-conflicts:868291-873154
 /subversion/branches/tree-conflicts-notify:873926-874008
 /subversion/branches/uris-as-urls:1060426-1064427
-/subversion/trunk:1146013,1146121,1146219,1146222,1146274,1146492,1146555,1146606,1146620,1146684,1146781,1146832,1146834,1146870,1146899,1146904,1147293,1147309,1147882,1148071,1148131,1148374,1148424,1148566,1148588,1148853,1148877,1148882,1148936,1149105,1149141,1149160,1149228,1149240,1149343,1149371-1149372,1149377,1149398,1149401,1149539,1149572,1149627,1149675,1149701,1149713,1150242,1150372,1150441,1150506,1150812,1150853,1151036,1151177,1151610,1151911,1152129,1152140,1152282,1152726,1153416,1153799,1153807
+/subversion/trunk:1146013,1146121,1146219,1146222,1146274,1146492,1146555,1146606,1146620,1146684,1146781,1146832,1146834,1146870,1146899,1146904,1147293,1147309,1147882,1148071,1148131,1148374,1148424,1148566,1148588,1148853,1148877,1148882,1148936,1149105,1149141,1149160,1149228,1149240,1149343,1149371-1149372,1149377,1149398,1149401,1149539,1149572,1149627,1149675,1149701,1149713,1150242,1150372,1150441,1150506,1150812,1150853,1151036,1151177,1151610,1151911,1152129,1152140,1152282,1152726,1153416,1153799,1153807,1153968

Modified: subversion/branches/1.7.x/STATUS
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x/STATUS?rev=1154028&r1=1154027&r2=1154028&view=diff
==============================================================================
--- subversion/branches/1.7.x/STATUS (original)
+++ subversion/branches/1.7.x/STATUS Thu Aug  4 21:55:53 2011
@@ -201,11 +201,3 @@ Approved changes:
      +1: rhuijben, cmpilato, hwright
      +0: danielsh (we shouldn't depend on libsvn_client fixes to avoid
                    accumulating tempfiles on the server)
-
- * r1153968
-   Add --trust-server-cert option to svnrdump, too.
-   Justification:
-     Consistency with our other network tools.
-   Votes:
-     +1: cmpilato, gstein, hwright
-     +0: danielsh

Modified: subversion/branches/1.7.x/subversion/svnrdump/svnrdump.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x/subversion/svnrdump/svnrdump.c?rev=1154028&r1=1154027&r2=1154028&view=diff
==============================================================================
--- subversion/branches/1.7.x/subversion/svnrdump/svnrdump.c (original)
+++ subversion/branches/1.7.x/subversion/svnrdump/svnrdump.c Thu Aug  4 21:55:53 2011
@@ -79,6 +79,7 @@ enum svn_svnrdump__longopt_t
     opt_auth_nocache,
     opt_non_interactive,
     opt_incremental,
+    opt_trust_server_cert,
     opt_version,
   };
 
@@ -87,6 +88,7 @@ enum svn_svnrdump__longopt_t
                                    opt_auth_username, \
                                    opt_auth_password, \
                                    opt_auth_nocache, \
+                                   opt_trust_server_cert, \
                                    opt_non_interactive
 
 static const svn_opt_subcommand_desc2_t svnrdump__cmd_table[] =
@@ -138,6 +140,12 @@ static const apr_getopt_option_t svnrdum
                          "For example:\n"
                          "                             "
                          "    servers:global:http-library=serf")},
+    {"trust-server-cert", opt_trust_server_cert, 0,
+                      N_("accept SSL server certificates from unknown\n"
+                         "                             "
+                         "certificate authorities without prompting (but only\n"
+                         "                             "
+                         "with '--non-interactive')") },
     {0, 0, 0, 0}
   };
 
@@ -250,6 +258,7 @@ init_client_context(svn_client_ctx_t **c
                     const char *password,
                     const char *config_dir,
                     svn_boolean_t no_auth_cache,
+                    svn_boolean_t trust_server_cert,
                     apr_array_header_t *config_options,
                     apr_pool_t *pool)
 {
@@ -276,9 +285,9 @@ init_client_context(svn_client_ctx_t **c
   /* Default authentication providers for non-interactive use */
   SVN_ERR(svn_cmdline_create_auth_baton(&(ctx->auth_baton), non_interactive,
                                         username, password, config_dir,
-                                        no_auth_cache, FALSE, cfg_config,
-                                        ctx->cancel_func, ctx->cancel_baton,
-                                        pool));
+                                        no_auth_cache, trust_server_cert,
+                                        cfg_config, ctx->cancel_func,
+                                        ctx->cancel_baton, pool));
   *ctx_p = ctx;
   return SVN_NO_ERROR;
 }
@@ -665,6 +674,7 @@ main(int argc, const char **argv)
   const char *username = NULL;
   const char *password = NULL;
   svn_boolean_t no_auth_cache = FALSE;
+  svn_boolean_t trust_server_cert = FALSE;
   svn_boolean_t non_interactive = FALSE;
   apr_array_header_t *config_options = NULL;
   apr_getopt_t *os;
@@ -794,6 +804,9 @@ main(int argc, const char **argv)
         case opt_incremental:
           opt_baton->incremental = TRUE;
           break;
+        case opt_trust_server_cert:
+          trust_server_cert = TRUE;
+          break;
         case opt_config_option:
           if (!config_options)
               config_options =
@@ -901,6 +914,15 @@ main(int argc, const char **argv)
       exit(EXIT_SUCCESS);
     }
 
+  /* --trust-server-cert can only be used with --non-interactive */
+  if (trust_server_cert && !non_interactive)
+    {
+      err = svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+                             _("--trust-server-cert requires "
+                               "--non-interactive"));
+      return svn_cmdline_handle_exit_error(err, pool, "svnrdump: ");
+    }
+
   /* Expect one more non-option argument:  the repository URL. */
   if (os->ind != os->argc - 1)
     {
@@ -932,6 +954,7 @@ main(int argc, const char **argv)
                                    password,
                                    config_dir,
                                    no_auth_cache,
+                                   trust_server_cert,
                                    config_options,
                                    pool));