You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2014/02/26 16:50:16 UTC

svn commit: r1572106 - in /subversion/trunk/subversion: svn/help-cmd.c tests/cmdline/getopt_tests.py tests/cmdline/getopt_tests_data/svn--version--verbose_stdout tests/cmdline/getopt_tests_data/svn--version_stdout

Author: stsp
Date: Wed Feb 26 15:50:16 2014
New Revision: 1572106

URL: http://svn.apache.org/r1572106
Log:
Make 'svn --version' show available authentication credential caches.

* subversion/svn/help-cmd.c
  (svn_cl__help): Append auth creds storage providers to the version
   footer shown in --version output.

* subversion/tests/cmdline/getopt_tests.py
  (del_lines_res): Add patterns to delete auth-cache related lines
   from --version output.
   
* subversion/tests/cmdline/getopt_tests_data/svn--version--verbose_stdout,
  subversion/tests/cmdline/getopt_tests_data/svn--version_stdout,
   Adjust expected output.

Modified:
    subversion/trunk/subversion/svn/help-cmd.c
    subversion/trunk/subversion/tests/cmdline/getopt_tests.py
    subversion/trunk/subversion/tests/cmdline/getopt_tests_data/svn--version--verbose_stdout
    subversion/trunk/subversion/tests/cmdline/getopt_tests_data/svn--version_stdout

Modified: subversion/trunk/subversion/svn/help-cmd.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/help-cmd.c?rev=1572106&r1=1572105&r2=1572106&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/help-cmd.c (original)
+++ subversion/trunk/subversion/svn/help-cmd.c Wed Feb 26 15:50:16 2014
@@ -31,6 +31,7 @@
 #include "svn_hash.h"
 #include "svn_string.h"
 #include "svn_config.h"
+#include "svn_dirent_uri.h"
 #include "svn_error.h"
 #include "cl.h"
 
@@ -45,6 +46,7 @@ svn_cl__help(apr_getopt_t *os,
 {
   svn_cl__opt_state_t *opt_state = NULL;
   svn_stringbuf_t *version_footer = NULL;
+  const char *config_path;
 
   char help_header[] =
   N_("usage: svn <subcommand> [options] [args]\n"
@@ -132,6 +134,46 @@ svn_cl__help(apr_getopt_t *os,
     version_footer = svn_stringbuf_create(ra_desc_start, pool);
   SVN_ERR(svn_ra_print_modules(version_footer, pool));
 
+  /*
+   * Show auth creds storage providers.
+   */
+  SVN_ERR(svn_config_get_user_config_path(&config_path,
+                                          opt_state ? opt_state->config_dir
+                                                    : NULL,
+                                          NULL,
+                                          pool));
+  svn_stringbuf_appendcstr(version_footer,
+                           _("\nThe following authentication credential caches are available:\n\n"));
+
+  /*### There is no API to query available providers at run time. */
+#if (defined(WIN32) && !defined(__MINGW32__))
+  version_footer =
+    svn_stringbuf_create(apr_psprintf(pool, _("%s* Wincrypt cache in %s\n"),
+                                      version_footer->data,
+                                      svn_dirent_local_style(config_path,
+                                                             pool)),
+                         pool);
+#elif !defined(SVN_DISABLE_PLAINTEXT_PASSWORD_STORAGE)
+  version_footer =
+    svn_stringbuf_create(apr_psprintf(pool, _("%s* Plaintext cache in %s\n"),
+                                      version_footer->data,
+                                      svn_dirent_local_style(config_path,
+                                                             pool)),
+                         pool);
+#endif
+#ifdef SVN_HAVE_GNOME_KEYRING
+  svn_stringbuf_appendcstr(version_footer, "* Gnome Keyring\n");
+#endif
+#ifdef SVN_HAVE_GPG_AGENT
+  svn_stringbuf_appendcstr(version_footer, "* GPG-Agent\n");
+#endif
+#ifdef SVN_HAVE_KEYCHAIN_SERVICES
+  svn_stringbuf_appendcstr(version_footer, "* Mac OS X Keychain\n");
+#endif
+#ifdef SVN_HAVE_KWALLET
+  svn_stringbuf_appendcstr(version_footer, "* KWallet (KDE)\n");
+#endif
+
   return svn_opt_print_help4(os,
                              "svn",   /* ### erm, derive somehow? */
                              opt_state ? opt_state->version : FALSE,

Modified: subversion/trunk/subversion/tests/cmdline/getopt_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/getopt_tests.py?rev=1572106&r1=1572105&r2=1572106&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/getopt_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/getopt_tests.py Wed Feb 26 15:50:16 2014
@@ -74,6 +74,15 @@ del_lines_res = [
                  re.compile(r"  - with Cyrus SASL authentication"),
                  re.compile(r"  - using serf \d+\.\d+\.\d+"),
                  re.compile(r"\* fs_(base|fs) :"),
+
+                 # Remove 'svn --version' list of platform-specific
+                 # auth cache providers.
+                 re.compile(r"\* Wincrypt cache.*"),
+                 re.compile(r"\* Plaintext cache.*"),
+                 re.compile(r"\* Gnome Keyring"),
+                 re.compile(r"\* GPG-Agent"),
+                 re.compile(r"\* Mac OS X Keychain"),
+                 re.compile(r"\* Kwallet \(KDE\)"),
                 ]
 
 # This is a list of lines to search and replace text on.

Modified: subversion/trunk/subversion/tests/cmdline/getopt_tests_data/svn--version--verbose_stdout
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/getopt_tests_data/svn--version--verbose_stdout?rev=1572106&r1=1572105&r2=1572106&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/getopt_tests_data/svn--version--verbose_stdout (original)
+++ subversion/trunk/subversion/tests/cmdline/getopt_tests_data/svn--version--verbose_stdout Wed Feb 26 15:50:16 2014
@@ -1,5 +1,5 @@
-svn, version 1.8.0-dev (under development)
-   compiled Sep 10 2012, 14:00:24 on i386-apple-darwin11.4.0
+svn, version 1.9.0-dev (under development)
+   compiled Feb 26 2014, 15:15:42 on x86_64-unknown-openbsd5.5
 
 Copyright (C) 2012 The Apache Software Foundation.
 This software consists of contributions made by many people;
@@ -14,9 +14,16 @@ The following repository access (RA) mod
 * ra_local : Module for accessing a repository on local disk.
   - handles 'file' scheme
 * ra_serf : Module for accessing a repository via WebDAV protocol using serf.
+  - using serf 1.3.3
   - handles 'http' scheme
   - handles 'https' scheme
 
+The following authentication credential caches are available:
+
+* Plaintext cache in /home/stsp/.subversion
+* Gnome Keyring
+* GPG-Agent
+
 System information:
 
 * running on i386-apple-darwin11.4.0

Modified: subversion/trunk/subversion/tests/cmdline/getopt_tests_data/svn--version_stdout
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/getopt_tests_data/svn--version_stdout?rev=1572106&r1=1572105&r2=1572106&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/getopt_tests_data/svn--version_stdout (original)
+++ subversion/trunk/subversion/tests/cmdline/getopt_tests_data/svn--version_stdout Wed Feb 26 15:50:16 2014
@@ -1,18 +1,26 @@
-svn, version 0.16.0 (r3987)
-   compiled Dec  5 2002, 00:02:51
+svn, version 1.9.0-dev (under development)
+   compiled Feb 26 2014, 15:15:42 on x86_64-unknown-openbsd5.5
 
-Copyright (C) 2010 The Apache Software Foundation.
+Copyright (C) 2014 The Apache Software Foundation.
 This software consists of contributions made by many people;
 see the NOTICE file for more information.
 Subversion is open source software, see http://subversion.apache.org/
 
 The following repository access (RA) modules are available:
 
-* ra_neon : Module for accessing a repository via WebDAV protocol using Neon.
-  - handles 'http' scheme
-  - handles 'https' scheme
-* ra_local : Module for accessing a repository on local disk.
-  - handles 'file' scheme
 * ra_svn : Module for accessing a repository using the svn network protocol.
+  - with Cyrus SASL authentication
   - handles 'svn' scheme
+* ra_local : Module for accessing a repository on local disk.
+  - handles 'file' scheme
+* ra_serf : Module for accessing a repository via WebDAV protocol using serf.
+  - using serf 1.3.3
+  - handles 'http' scheme
+  - handles 'https' scheme
+
+The following authentication credential caches are available:
+
+* Plaintext cache in /home/stsp/.subversion
+* Gnome Keyring
+* GPG-Agent