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

Re: [PATCH] svnmucc doesn't honor --config-dir for auth stuff

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Wed, 24 Aug 2011 15:57:46 +0300

[ Please send attachments as text/plain (eg, *.txt) so that our mailers
show them inline when reading/replying. Thanks. ]

Roderich Schupp wrote on Wed, Aug 24, 2011 at 14:28:46 +0200:
> Hi,
>
> svnmucc doesn't honor option --config-dir when it comes to stuff
> stored below config_dir/auth.
>
> To reproduce:
> - access a remote repository that will store information below
> config_dir/auth, e.g.
> username/password or permanently accepted SSL server certificate,
> using svn command
> without --config-dir (i.e. default config_dir ~/.subversion is used)
> - try to access the same repository with "svnmucc --config-dir
> /non/existent/directory ..."
> and wonder why svnmucc doesn't prompt again for the above information
>
> Suggested patch against trunk attached.
>
> [[[
> Make svnmucc honor option --config-dir for auth stuff.
>
> * tools/client-side/svnmucc/svnmucc.c
> (create_ra_callbacks) Add parameter config_dir, pass it to
> svn_cmdline_create_auth_baton.
> (execute) Pass config_dir to create_ra_callbacks.
> ]]]
>
>
> Cheers, Roderich

> --- tools/client-side/svnmucc/svnmucc.c.orig 2011-08-24 09:26:34.933787000 +0200
> +++ tools/client-side/svnmucc/svnmucc.c 2011-08-24 09:30:43.188708000 +0200
> @@ -108,6 +108,7 @@
> create_ra_callbacks(svn_ra_callbacks2_t **callbacks,
> const char *username,
> const char *password,
> + const char *config_dir,
> svn_boolean_t non_interactive,
> svn_boolean_t no_auth_cache,
> apr_pool_t *pool)
> @@ -116,7 +117,7 @@
>
> SVN_ERR(svn_cmdline_create_auth_baton(&(*callbacks)->auth_baton,
> non_interactive,
> - username, password, NULL, no_auth_cache,
> + username, password, config_dir, no_auth_cache,
> FALSE, NULL, NULL, NULL, pool));
>
> (*callbacks)->open_tmp_file = open_tmp_file;
> @@ -635,7 +636,7 @@
> SVN_ERR(svn_config_get_config(&config, config_dir, pool));
> SVN_ERR(svn_cmdline__apply_config_options(config, config_options,
> "svnmucc: ", "--config-option"));
> - SVN_ERR(create_ra_callbacks(&ra_callbacks, username, password,
> + SVN_ERR(create_ra_callbacks(&ra_callbacks, username, password, config_dir,
> non_interactive, no_auth_cache, pool));
> SVN_ERR(svn_ra_open4(&session, NULL, anchor, NULL, ra_callbacks,
> NULL, config, pool));

Philip just applied the patch.

There seem to be further opportunities for improvement here, though:

- The FALSE/NULL parameters to svn_cmdline_create_auth_baton(). At
  least the CONFIG parameter could be easily populated too, since the
  caller already has a config hash.

- If ~/.subversion is unreadable (chmod 0), then svnmucc just errors out.
  (We fixed that for 'svn' some time ago; now it only issues a warning.)
Received on 2011-08-24 14:58:30 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.