You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by br...@apache.org on 2015/08/26 08:45:03 UTC
svn commit: r1697824 - in /subversion/trunk/subversion/libsvn_subr: auth.c
auth.h deprecated.c
Author: brane
Date: Wed Aug 26 06:45:03 2015
New Revision: 1697824
URL: http://svn.apache.org/r1697824
Log:
Follow up to r1694481: Do not remove a public API implementation.
* subversion/libsvn_subr/auth.h
(svn_auth__get_dummmy_simple_provider): New prototype.
* subversion/libsvn_subr/auth.c
(dummy_first_creds): New.
(svn_auth__get_dummmy_simple_provider): Implement.
* subversion/libsvn_subr/deprecated.c
(svn_auth_get_gpg_agent_simple_provider): Always provide an implementation
on non-Windows platforms, but return a dummy provider if GPG agent
support is not available.
Modified:
subversion/trunk/subversion/libsvn_subr/auth.c
subversion/trunk/subversion/libsvn_subr/auth.h
subversion/trunk/subversion/libsvn_subr/deprecated.c
Modified: subversion/trunk/subversion/libsvn_subr/auth.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/auth.c?rev=1697824&r1=1697823&r2=1697824&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/auth.c (original)
+++ subversion/trunk/subversion/libsvn_subr/auth.c Wed Aug 26 06:45:03 2015
@@ -880,3 +880,33 @@ svn_auth__make_session_auth(svn_auth_bat
return SVN_NO_ERROR;
}
+
+
+static svn_error_t *
+dummy_first_creds(void **credentials,
+ void **iter_baton,
+ void *provider_baton,
+ apr_hash_t *parameters,
+ const char *realmstring,
+ apr_pool_t *pool)
+{
+ *credentials = NULL;
+ *iter_baton = NULL;
+ return SVN_NO_ERROR;
+}
+
+void
+svn_auth__get_dummmy_simple_provider(svn_auth_provider_object_t **provider,
+ apr_pool_t *pool)
+{
+ static const svn_auth_provider_t vtable = {
+ SVN_AUTH_CRED_SIMPLE,
+ dummy_first_creds,
+ NULL, NULL
+ };
+
+ svn_auth_provider_object_t *po = apr_pcalloc(pool, sizeof(*po));
+
+ po->vtable = &vtable;
+ *provider = po;
+}
Modified: subversion/trunk/subversion/libsvn_subr/auth.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/auth.h?rev=1697824&r1=1697823&r2=1697824&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/auth.h (original)
+++ subversion/trunk/subversion/libsvn_subr/auth.h Wed Aug 26 06:45:03 2015
@@ -157,6 +157,15 @@ svn_auth__get_gpg_agent_simple_provider
apr_pool_t *pool);
#endif /* !defined(WIN32) || defined(DOXYGEN) */
+/**
+ * Set @a *provider to a dummy provider of type @c
+ * svn_auth_cred_simple_t that never returns or stores any
+ * credentials.
+ */
+void
+svn_auth__get_dummmy_simple_provider(svn_auth_provider_object_t **provider,
+ apr_pool_t *pool);
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
Modified: subversion/trunk/subversion/libsvn_subr/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/deprecated.c?rev=1697824&r1=1697823&r2=1697824&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/deprecated.c (original)
+++ subversion/trunk/subversion/libsvn_subr/deprecated.c Wed Aug 26 06:45:03 2015
@@ -1497,14 +1497,16 @@ svn_auth_get_keychain_ssl_client_cert_pw
#endif /* DARWIN */
#if !defined(WIN32)
-#ifdef SVN_HAVE_GPG_AGENT
void
svn_auth_get_gpg_agent_simple_provider(svn_auth_provider_object_t **provider,
apr_pool_t *pool)
{
+#ifdef SVN_HAVE_GPG_AGENT
svn_auth__get_gpg_agent_simple_provider(provider, pool);
-}
+#else
+ svn_auth__get_dummmy_simple_provider(provider, pool);
#endif /* SVN_HAVE_GPG_AGENT */
+}
#endif /* !WIN32 */
svn_error_t *