git-svn: respect Subversion's [auth] section configuration values
Parameters 'store-passwords' and 'store-auth-creds' from Subversion's configuration (~/.subversion/config) were not respected. This was fixed: the default values for these parameters are set to 'yes' to follow Subversion behaviour. Signed-off-by: Eygene Ryabinkin <rea-git@codelabs.ru> Signed-off-by: Lars Hjemli <hjemli@gmail.com> Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Eygene Ryabinkin committed
Oct 6, 2007 at 22:57 UTC
602015e0e6ec5d3d79b71b0d5e2583fd015417e6
1 file changed
+23
git-svn.perl
+23
@@ -3065,6 +3065,29 @@ sub new {
3065
my ($baton, $callbacks) = SVN::Core::auth_open_helper(_auth_providers);
3066
my $config = SVN::Core::config_get_config($config_dir);
3067
$RA = undef;
3068
+ my $dont_store_passwords = 1;
3069
+ my $conf_t = ${$config}{'config'};
3070
+ {
3071
+ # The usage of $SVN::_Core::SVN_CONFIG_* variables
3072
+ # produces warnings that variables are used only once.
3073
+ # I had not found the better way to shut them up, so
3074
+ # warnings are disabled in this block.
3075
+ no warnings;
3076
+ if (SVN::_Core::svn_config_get_bool($conf_t,
3077
+ $SVN::_Core::SVN_CONFIG_SECTION_AUTH,
3078
+ $SVN::_Core::SVN_CONFIG_OPTION_STORE_PASSWORDS,
3079
+ 1) == 0) {
3080
+ SVN::_Core::svn_auth_set_parameter($baton,
3081
+ $SVN::_Core::SVN_AUTH_PARAM_DONT_STORE_PASSWORDS,
3082
+ bless (\$dont_store_passwords, "_p_void"));
3083
+ }
3084
+ if (SVN::_Core::svn_config_get_bool($conf_t,
3085
+ $SVN::_Core::SVN_CONFIG_SECTION_AUTH,
3086
+ $SVN::_Core::SVN_CONFIG_OPTION_STORE_AUTH_CREDS,
3087
+ 1) == 0) {
3088
+ $Git::SVN::Prompt::_no_auth_cache = 1;
3089
+ }
3090
+ }
3091
my $self = SVN::Ra->new(url => $url, auth => $baton,
3092
config => $config,
3093
pool => SVN::Pool->new,