You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2011/08/05 16:08:30 UTC
svn commit: r1154225 -
/subversion/trunk/subversion/bindings/javahl/native/ClientContext.cpp
Author: rhuijben
Date: Fri Aug 5 14:08:30 2011
New Revision: 1154225
URL: http://svn.apache.org/viewvc?rev=1154225&view=rev
Log:
* subversion/bindings/javahl/native/ClientContext.cpp
(ClientContext::getContext): If an explicit configuration directory is set,
copy the value to the authentication baton to retrieve (and store)
authentication information in the right place (See libsvn_subr/cmdline.c).
Copy baton variables in the pool instead of referencing the bytes
in std::string.
Modified:
subversion/trunk/subversion/bindings/javahl/native/ClientContext.cpp
Modified: subversion/trunk/subversion/bindings/javahl/native/ClientContext.cpp
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/ClientContext.cpp?rev=1154225&r1=1154224&r2=1154225&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/ClientContext.cpp (original)
+++ subversion/trunk/subversion/bindings/javahl/native/ClientContext.cpp Fri Aug 5 14:08:30 2011
@@ -158,7 +158,7 @@ ClientContext::getContext(CommitMessage
if (!ctx->config)
{
const char *configDir = m_configDir.c_str();
- if (m_configDir.length() == 0)
+ if (m_configDir.empty())
configDir = NULL;
SVN_JNI_ERR(svn_config_get_config(&(ctx->config), configDir,
m_pool->getPool()),
@@ -254,10 +254,17 @@ ClientContext::getContext(CommitMessage
* auth_baton's run-time parameter hash. ### Same with --no-auth-cache? */
if (!m_userName.empty())
svn_auth_set_parameter(ab, SVN_AUTH_PARAM_DEFAULT_USERNAME,
- m_userName.c_str());
+ apr_pstrdup(in_pool.getPool(),
+ m_userName.c_str()));
if (!m_passWord.empty())
svn_auth_set_parameter(ab, SVN_AUTH_PARAM_DEFAULT_PASSWORD,
- m_passWord.c_str());
+ apr_pstrdup(in_pool.getPool(),
+ m_passWord.c_str()));
+ /* Store where to retrieve authentication data? */
+ if (!m_configDir.empty())
+ svn_auth_set_parameter(ab, SVN_AUTH_PARAM_CONFIG_DIR,
+ apr_pstrdup(in_pool.getPool(),
+ m_configDir.c_str()));
ctx->auth_baton = ab;
ctx->log_msg_baton3 = message;