You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by sv...@apache.org on 2012/09/05 06:02:05 UTC

svn commit: r1380971 - in /subversion/branches/1.7.x: ./ STATUS subversion/libsvn_subr/auth.c

Author: svn-role
Date: Wed Sep  5 04:02:04 2012
New Revision: 1380971

URL: http://svn.apache.org/viewvc?rev=1380971&view=rev
Log:
Reintegrate the 1.7.x-r1375052 branch:

 * r1375052
   Don't complain about unknown password stores listed in the
   password-stores runtime configuration area -- simply ignore them.
   Justification:
     The runtime configuration must necessarily be compatible -- that
     is, at least functional -- across many versions of Subversion.
     Prior to this change, though, adding "gpg-agent" to the
     password-stores list so I can use that feature with my trunk
     client would cause my 1.7.x client to choke.
   Branch:
     ^/subversion/branches/1.7.x-r1375052
   Votes:
     +1: cmpilato, danielsh, rhuijben

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

Propchange: subversion/branches/1.7.x/
------------------------------------------------------------------------------
  Merged /subversion/branches/1.7.x-r1375052:r1376643-1380970
  Merged /subversion/trunk:r1375052

Modified: subversion/branches/1.7.x/STATUS
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x/STATUS?rev=1380971&r1=1380970&r2=1380971&view=diff
==============================================================================
--- subversion/branches/1.7.x/STATUS (original)
+++ subversion/branches/1.7.x/STATUS Wed Sep  5 04:02:04 2012
@@ -145,20 +145,6 @@ Veto-blocked changes:
 Approved changes:
 =================
 
- * r1375052
-   Don't complain about unknown password stores listed in the
-   password-stores runtime configuration area -- simply ignore them.
-   Justification:
-     The runtime configuration must necessarily be compatible -- that
-     is, at least functional -- across many versions of Subversion.
-     Prior to this change, though, adding "gpg-agent" to the
-     password-stores list so I can use that feature with my trunk
-     client would cause my 1.7.x client to choke.
-   Branch:
-     ^/subversion/branches/1.7.x-r1375052
-   Votes:
-     +1: cmpilato, danielsh, rhuijben
-
  * r1380697
    Fix duplicated Index: lines in 'svn diff' output with external diff tool.
    Justification:

Modified: subversion/branches/1.7.x/subversion/libsvn_subr/auth.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x/subversion/libsvn_subr/auth.c?rev=1380971&r1=1380970&r2=1380971&view=diff
==============================================================================
--- subversion/branches/1.7.x/subversion/libsvn_subr/auth.c (original)
+++ subversion/branches/1.7.x/subversion/libsvn_subr/auth.c Wed Sep  5 04:02:04 2012
@@ -494,30 +494,26 @@ svn_auth_get_platform_specific_client_pr
   apr_array_header_t *password_stores;
   int i;
 
-  if (config)
-    {
-      svn_config_get(config,
-                     &password_stores_config_option,
-                     SVN_CONFIG_SECTION_AUTH,
-                     SVN_CONFIG_OPTION_PASSWORD_STORES,
-                     "gnome-keyring,kwallet,keychain,windows-cryptoapi");
-    }
-  else
-    {
-      password_stores_config_option = "gnome-keyring,kwallet,keychain,windows-cryptoapi";
-    }
+#define SVN__MAYBE_ADD_PROVIDER(list, p) \
+  { if (p) APR_ARRAY_PUSH(list, svn_auth_provider_object_t *) = p; }
 
   *providers = apr_array_make(pool, 12, sizeof(svn_auth_provider_object_t *));
 
-  password_stores
-    = svn_cstring_split(password_stores_config_option, " ,", TRUE, pool);
+  /* Fetch the configured list of password stores, and split them into
+     an array. */
+  svn_config_get(config,
+                 &password_stores_config_option,
+                 SVN_CONFIG_SECTION_AUTH,
+                 SVN_CONFIG_OPTION_PASSWORD_STORES,
+                 "gnome-keyring,kwallet,keychain,windows-cryptoapi");
+  password_stores = svn_cstring_split(password_stores_config_option,
+                                      " ,", TRUE, pool);
 
   for (i = 0; i < password_stores->nelts; i++)
     {
       const char *password_store = APR_ARRAY_IDX(password_stores, i,
                                                  const char *);
 
-
       /* GNOME Keyring */
       if (apr_strnatcmp(password_store, "gnome-keyring") == 0)
         {
@@ -525,90 +521,59 @@ svn_auth_get_platform_specific_client_pr
                                                           "gnome_keyring",
                                                           "simple",
                                                           pool));
-
-          if (provider)
-            APR_ARRAY_PUSH(*providers, svn_auth_provider_object_t *) = provider;
+          SVN__MAYBE_ADD_PROVIDER(*providers, provider);
 
           SVN_ERR(svn_auth_get_platform_specific_provider(&provider,
                                                           "gnome_keyring",
                                                           "ssl_client_cert_pw",
                                                           pool));
-
-          if (provider)
-            APR_ARRAY_PUSH(*providers, svn_auth_provider_object_t *) = provider;
-
-          continue;
+          SVN__MAYBE_ADD_PROVIDER(*providers, provider);
         }
-
       /* KWallet */
-      if (apr_strnatcmp(password_store, "kwallet") == 0)
+      else if (apr_strnatcmp(password_store, "kwallet") == 0)
         {
           SVN_ERR(svn_auth_get_platform_specific_provider(&provider,
                                                           "kwallet",
                                                           "simple",
                                                           pool));
-
-          if (provider)
-            APR_ARRAY_PUSH(*providers, svn_auth_provider_object_t *) = provider;
+          SVN__MAYBE_ADD_PROVIDER(*providers, provider);
 
           SVN_ERR(svn_auth_get_platform_specific_provider(&provider,
                                                           "kwallet",
                                                           "ssl_client_cert_pw",
                                                           pool));
-          if (provider)
-            APR_ARRAY_PUSH(*providers, svn_auth_provider_object_t *) = provider;
-
-          continue;
+          SVN__MAYBE_ADD_PROVIDER(*providers, provider);
         }
-
       /* Keychain */
-      if (apr_strnatcmp(password_store, "keychain") == 0)
+      else if (apr_strnatcmp(password_store, "keychain") == 0)
         {
           SVN_ERR(svn_auth_get_platform_specific_provider(&provider,
                                                           "keychain",
                                                           "simple",
                                                           pool));
-
-          if (provider)
-            APR_ARRAY_PUSH(*providers, svn_auth_provider_object_t *) = provider;
+          SVN__MAYBE_ADD_PROVIDER(*providers, provider);
 
           SVN_ERR(svn_auth_get_platform_specific_provider(&provider,
                                                           "keychain",
                                                           "ssl_client_cert_pw",
                                                           pool));
-
-          if (provider)
-            APR_ARRAY_PUSH(*providers, svn_auth_provider_object_t *) = provider;
-
-          continue;
+          SVN__MAYBE_ADD_PROVIDER(*providers, provider);
         }
-
       /* Windows */
-      if (apr_strnatcmp(password_store, "windows-cryptoapi") == 0)
+      else if (apr_strnatcmp(password_store, "windows-cryptoapi") == 0)
         {
           SVN_ERR(svn_auth_get_platform_specific_provider(&provider,
                                                           "windows",
                                                           "simple",
                                                           pool));
-
-          if (provider)
-            APR_ARRAY_PUSH(*providers, svn_auth_provider_object_t *) = provider;
+          SVN__MAYBE_ADD_PROVIDER(*providers, provider);
 
           SVN_ERR(svn_auth_get_platform_specific_provider(&provider,
                                                           "windows",
                                                           "ssl_client_cert_pw",
                                                           pool));
-
-          if (provider)
-            APR_ARRAY_PUSH(*providers, svn_auth_provider_object_t *) = provider;
-
-          continue;
+          SVN__MAYBE_ADD_PROVIDER(*providers, provider);
         }
-
-      return svn_error_createf(SVN_ERR_BAD_CONFIG_VALUE, NULL,
-                               _("Invalid config: unknown password store "
-                                 "'%s'"),
-                               password_store);
     }
 
   return SVN_NO_ERROR;