You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by cm...@apache.org on 2012/08/06 20:35:34 UTC
svn commit: r1369915 - in /subversion/branches/master-passphrase/subversion:
libsvn_subr/auth_store.c libsvn_subr/auth_store.h libsvn_subr/cmdline.c
libsvn_subr/config_auth_store.c libsvn_subr/pathetic_auth_store.c
tests/libsvn_subr/crypto-test.c
Author: cmpilato
Date: Mon Aug 6 18:35:34 2012
New Revision: 1369915
URL: http://svn.apache.org/viewvc?rev=1369915&view=rev
Log:
On the 'master-passphrase' branch: Disentangle auth store
opening/creation actions.
* subversion/libsvn_subr/auth_store.h
(svn_auth__store_cb_open_t, svn_auth__store_open): Lose 'create' parameter.
(svn_auth__pathetic_store_get): Remove notes about store creation.
(svn_auth__config_store_get): Add note about auto-creation.
* subversion/libsvn_subr/auth_store.c
(svn_auth__store_open): Remove 'create' parameter and handling.
(svn_auth__get_store_from_parameters): Update call to svn_auth__store_open().
* subversion/libsvn_subr/cmdline.c
(open_auth_store): Update call to svn_auth__store_open().
* subversion/libsvn_subr/config_auth_store.c
(config_store_open): Remove 'create' parameter.
* subversion/libsvn_subr/pathetic_auth_store.c
(pathetic_store_open): Remove 'create' parameter.
* subversion/tests/libsvn_subr/crypto-test.c
(create_ephemeral_auth_store, test_auth_store_basic): Update calls
to svn_auth__store_open().
Modified:
subversion/branches/master-passphrase/subversion/libsvn_subr/auth_store.c
subversion/branches/master-passphrase/subversion/libsvn_subr/auth_store.h
subversion/branches/master-passphrase/subversion/libsvn_subr/cmdline.c
subversion/branches/master-passphrase/subversion/libsvn_subr/config_auth_store.c
subversion/branches/master-passphrase/subversion/libsvn_subr/pathetic_auth_store.c
subversion/branches/master-passphrase/subversion/tests/libsvn_subr/crypto-test.c
Modified: subversion/branches/master-passphrase/subversion/libsvn_subr/auth_store.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_subr/auth_store.c?rev=1369915&r1=1369914&r2=1369915&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_subr/auth_store.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_subr/auth_store.c Mon Aug 6 18:35:34 2012
@@ -122,14 +122,12 @@ cleanup_auth_store_close(void *arg)
svn_error_t *
svn_auth__store_open(svn_auth__store_t *auth_store,
- svn_boolean_t create,
apr_pool_t *scratch_pool)
{
SVN_ERR_ASSERT(! auth_store->is_open);
if (auth_store->open_func)
{
- SVN_ERR(auth_store->open_func(auth_store->store_baton, create,
- scratch_pool));
+ SVN_ERR(auth_store->open_func(auth_store->store_baton, scratch_pool));
/* Register a pool cleanup handler which closes the store. */
apr_pool_cleanup_register(auth_store->pool, auth_store,
@@ -357,7 +355,7 @@ svn_auth__get_store_from_parameters(svn_
SVN_ERR(svn_auth__config_store_get(auth_store, config_dir,
apr_hash_pool_get(parameters),
pool));
- SVN_ERR(svn_auth__store_open(*auth_store, FALSE, pool));
+ SVN_ERR(svn_auth__store_open(*auth_store, pool));
apr_hash_set(parameters,
SVN_AUTH_PARAM_AUTH_STORE,
APR_HASH_KEY_STRING,
Modified: subversion/branches/master-passphrase/subversion/libsvn_subr/auth_store.h
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_subr/auth_store.h?rev=1369915&r1=1369914&r2=1369915&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_subr/auth_store.h (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_subr/auth_store.h Mon Aug 6 18:35:34 2012
@@ -53,11 +53,9 @@ typedef svn_error_t *(*svn_auth__store_i
/* Authentication credential store object. */
typedef struct svn_auth__store_t svn_auth__store_t;
-/* Callback type: Open (creating if necessary and if CREATE is TRUE)
- an authentication store. */
+/* Callback type: Open an authentication store. */
typedef svn_error_t *(*svn_auth__store_cb_open_t)(
void *baton,
- svn_boolean_t create,
apr_pool_t *scratch_pool);
/* Callback type: Close an authentication store. */
@@ -146,11 +144,9 @@ svn_auth__store_set_iterate_creds(svn_au
svn_auth__store_cb_iterate_creds_t func);
-/* Open (creating if necessary and if CREATE is set) the
- authentication credential store identified by AUTH_STORE. */
+/* Open the authentication credential store identified by AUTH_STORE. */
svn_error_t *
svn_auth__store_open(svn_auth__store_t *auth_store,
- svn_boolean_t create,
apr_pool_t *scratch_pool);
/* Close the auth store represented by AUTH_STORE. */
@@ -215,11 +211,6 @@ svn_auth__store_iterate_creds(svn_auth__
by SECRET_FUNC does not validate against an existing store's
checktext.
- NOTE: An auth store opened via this interface will error out if
- asked to "create" its persistent details via
- svn_auth__store_open(create=TRUE). Use
- svn_auth__pathetic_store_create() for that purpose.
-
### TODO: This is expected to be experimental code! ###
*/
svn_error_t *
@@ -262,6 +253,9 @@ svn_auth__pathetic_store_reencrypt(const
runtime-config-based authentication credential store located at
AUTH_STORE_PATH. CFG is the configuration object with which the
store is associated.
+
+ NOTE: This auth-store will be automatically created if not already
+ present on disk.
*/
svn_error_t *
svn_auth__config_store_get(svn_auth__store_t **auth_store_p,
Modified: subversion/branches/master-passphrase/subversion/libsvn_subr/cmdline.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_subr/cmdline.c?rev=1369915&r1=1369914&r2=1369915&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_subr/cmdline.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_subr/cmdline.c Mon Aug 6 18:35:34 2012
@@ -527,7 +527,7 @@ open_auth_store(svn_auth__store_t **auth
SVN_ERR(svn_auth__config_store_get(&auth_store, config_dir, pool, pool));
}
- SVN_ERR(svn_auth__store_open(auth_store, TRUE, pool));
+ SVN_ERR(svn_auth__store_open(auth_store, pool));
*auth_store_p = auth_store;
return SVN_NO_ERROR;
}
Modified: subversion/branches/master-passphrase/subversion/libsvn_subr/config_auth_store.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_subr/config_auth_store.c?rev=1369915&r1=1369914&r2=1369915&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_subr/config_auth_store.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_subr/config_auth_store.c Mon Aug 6 18:35:34 2012
@@ -39,7 +39,6 @@
/* Implements svn_auth__store_cb_open_t. */
static svn_error_t *
config_store_open(void *baton,
- svn_boolean_t create,
apr_pool_t *scratch_pool)
{
return SVN_NO_ERROR;
Modified: subversion/branches/master-passphrase/subversion/libsvn_subr/pathetic_auth_store.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_subr/pathetic_auth_store.c?rev=1369915&r1=1369914&r2=1369915&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_subr/pathetic_auth_store.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_subr/pathetic_auth_store.c Mon Aug 6 18:35:34 2012
@@ -435,7 +435,6 @@ acquire_secret(pathetic_auth_store_baton
/* Implements svn_auth__store_cb_open_t. */
static svn_error_t *
pathetic_store_open(void *baton,
- svn_boolean_t create,
apr_pool_t *scratch_pool)
{
pathetic_auth_store_baton_t *auth_store = baton;
Modified: subversion/branches/master-passphrase/subversion/tests/libsvn_subr/crypto-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/tests/libsvn_subr/crypto-test.c?rev=1369915&r1=1369914&r2=1369915&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/tests/libsvn_subr/crypto-test.c (original)
+++ subversion/branches/master-passphrase/subversion/tests/libsvn_subr/crypto-test.c Mon Aug 6 18:35:34 2012
@@ -134,7 +134,7 @@ create_ephemeral_auth_store(svn_auth__st
SVN_ERR(get_master_passphrase_auth_baton(&auth_baton, secret, pool));
SVN_ERR(svn_auth__pathetic_store_get(auth_store_p, *auth_store_path,
auth_baton, crypto_ctx, pool, pool));
- SVN_ERR(svn_auth__store_open(*auth_store_p, FALSE, pool));
+ SVN_ERR(svn_auth__store_open(*auth_store_p, pool));
return SVN_NO_ERROR;
}
@@ -260,14 +260,14 @@ test_auth_store_basic(apr_pool_t *pool)
SVN_ERR(get_master_passphrase_auth_baton(&auth_baton, secret, pool));
SVN_ERR(svn_auth__pathetic_store_get(&auth_store, auth_store_path,
auth_baton, ctx, pool, pool));
- SVN_ERR(svn_auth__store_open(auth_store, FALSE, pool));
+ SVN_ERR(svn_auth__store_open(auth_store, pool));
/* Close and reopen the auth store with a bogus secret. */
SVN_ERR(svn_auth__store_close(auth_store, pool));
SVN_ERR(get_master_passphrase_auth_baton(&auth_baton, bad_secret, pool));
SVN_ERR(svn_auth__pathetic_store_get(&auth_store, auth_store_path,
auth_baton, ctx, pool, pool));
- err = svn_auth__store_open(auth_store, FALSE, pool);
+ err = svn_auth__store_open(auth_store, pool);
if (! err)
return svn_error_create(SVN_ERR_TEST_FAILED, NULL,
"Successfully opened auth store with the wrong "