[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r31428 - in trunk/subversion: include libsvn_subr

From: Arfrever Frehtes Taifersar Arahesis <arfrever.fta_at_gmail.com>
Date: Sun, 25 May 2008 14:29:33 +0200

2008-05-24 22:22:10 arfrever_at_tigris.org napisał(a):
> Author: arfrever
> Date: Sat May 24 13:22:10 2008
> New Revision: 31428
>
> Log:
> Implement the 'password-stores' config option.
>
> * subversion/include/svn_config.h
> (SVN_CONFIG_OPTION_PASSWORD_STORES): Define.
>
> * subversion/libsvn_subr/config_file.c
> (svn_config_ensure): Update the default 'config' file.
>
> * subversion/libsvn_subr/cmdline.c
> (svn_cmdline_setup_auth_baton): Use the 'password-stores' option
> to determine order of dynamically loaded auth simple providers.
>
> Modified:
> trunk/subversion/include/svn_config.h
> trunk/subversion/libsvn_subr/cmdline.c
> trunk/subversion/libsvn_subr/config_file.c
>
> Modified: trunk/subversion/include/svn_config.h
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/include/svn_config.h?pathrev=31428&r1=31427&r2=31428
> ==============================================================================
> --- trunk/subversion/include/svn_config.h Sat May 24 10:07:45 2008 (r31427)
> +++ trunk/subversion/include/svn_config.h Sat May 24 13:22:10 2008 (r31428)
> @@ -80,8 +80,9 @@ typedef struct svn_config_t svn_config_t
>
> #define SVN_CONFIG_CATEGORY_CONFIG "config"
> #define SVN_CONFIG_SECTION_AUTH "auth"
> -/* The "auth" section has been deprecated.
> - * Its options have been moved to SVN_CONFIG_CATEGORY_SERVERS. */
> +#define SVN_CONFIG_OPTION_PASSWORD_STORES "password-stores"
> +/* The majority of options of the "auth" section
> + * has been moved to SVN_CONFIG_CATEGORY_SERVERS. */
> #define SVN_CONFIG_SECTION_HELPERS "helpers"
> #define SVN_CONFIG_OPTION_EDITOR_CMD "editor-cmd"
> #define SVN_CONFIG_OPTION_DIFF_CMD "diff-cmd"
>
> Modified: trunk/subversion/libsvn_subr/cmdline.c
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_subr/cmdline.c?pathrev=31428&r1=31427&r2=31428
> ==============================================================================
> --- trunk/subversion/libsvn_subr/cmdline.c Sat May 24 10:07:45 2008 (r31427)
> +++ trunk/subversion/libsvn_subr/cmdline.c Sat May 24 13:22:10 2008 (r31428)
> @@ -435,17 +435,45 @@ svn_cmdline_setup_auth_baton(svn_auth_ba
> svn_auth_get_keychain_simple_provider(&provider, pool);
> APR_ARRAY_PUSH(providers, svn_auth_provider_object_t *) = provider;
> #endif
> +#if defined(SVN_HAVE_GNOME_KEYRING) || defined(SVN_HAVE_KWALLET)
> + const char *password_stores_config_option;
> + svn_config_get(cfg,
> + &password_stores_config_option,
> + SVN_CONFIG_SECTION_AUTH,
> + SVN_CONFIG_OPTION_PASSWORD_STORES,
> + "gnome-keyring,kwallet");
> +
> + apr_array_header_t *password_stores
> + = svn_cstring_split(password_stores_config_option, " ,", TRUE, pool);
> +
> + int i;
> + for (i = 0; i < password_stores->nelts; i++)
> + {
> + const char *password_store = APR_ARRAY_IDX(password_stores, i,
> + const char *);
> #ifdef SVN_HAVE_GNOME_KEYRING
> - if (get_auth_simple_provider(&provider, "gnome_keyring", pool))
> - {
> - APR_ARRAY_PUSH(providers, svn_auth_provider_object_t *) = provider;
> - }
> + if (apr_strnatcmp(password_store, "gnome-keyring") == 0)
> + {
> + if (get_auth_simple_provider(&provider, "gnome_keyring", pool))
> + {
> + APR_ARRAY_PUSH(providers, svn_auth_provider_object_t *) = provider;
> + }
> + continue;
> + }
> #endif
> #ifdef SVN_HAVE_KWALLET
> - if (get_auth_simple_provider(&provider, "kwallet", pool))
> - {
> - APR_ARRAY_PUSH(providers, svn_auth_provider_object_t *) = provider;
> + if (apr_strnatcmp(password_store, "kwallet") == 0)
> + {
> + if (get_auth_simple_provider(&provider, "kwallet", pool))
> + {
> + APR_ARRAY_PUSH(providers, svn_auth_provider_object_t *) = provider;
> + }
> + continue;
> + }
> +#endif
> + /* TODO: Error. */

Which error code should be used for invalid value of DAV-unrelated configuration option?

> }
> +// SVN_ERR(add_dynamically_loaded_auth_simple_providers_to_array(&providers, cfg, pool));
> #endif
> if (non_interactive == FALSE)
> {

-- 
Arfrever Frehtes Taifersar Arahesis

Received on 2008-05-25 14:35:39 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.