Skip to content

Commit 0b66415

Browse files
Eric Wonggitster
authored andcommitted
git-svn: fix auth parameter handling on SVN 1.9.0+
For users with "store-passwords = no" set in the "[auth]" section of their ~/.subversion/config, SVN 1.9.0+ would fail with the following message when attempting to call svn_auth_set_parameter: Value is not a string (or undef) at Git/SVN/Ra.pm Ironically, this breakage was caused by r1553823 in subversion: "Make svn_auth_set_parameter() usable from Perl bindings." Since 2007 (602015e), git-svn has used a workaround to make svn_auth_set_parameter usable internally. However this workaround breaks under SVN 1.9+, which deals properly with the type mapping and fails to recognize our workaround. For pre-1.9.0 SVN, we continue to use the existing workaround for the lack of proper type mapping in the bindings. Tested under subversion 1.6.17 and 1.9.3. I've also verified r1553823 was not backported to SVN 1.8.x: BRANCH=http://svn.apache.org/repos/asf/subversion/branches/1.8.x svn log -v $BRANCH/subversion/bindings/swig/core.i ref: https://bugs.debian.org/797705 Cc: [email protected] Reported-by: Thierry Vignaud <[email protected]> Signed-off-by: Eric Wong <[email protected]> Tested-by: Thierry Vignaud <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 833e482 commit 0b66415

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

perl/Git/SVN/Ra.pm

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ sub prepare_config_once {
8181
SVN::_Core::svn_config_ensure($config_dir, undef);
8282
my ($baton, $callbacks) = SVN::Core::auth_open_helper(_auth_providers);
8383
my $config = SVN::Core::config_get_config($config_dir);
84-
my $dont_store_passwords = 1;
8584
my $conf_t = $config->{'config'};
8685

8786
no warnings 'once';
@@ -93,9 +92,14 @@ sub prepare_config_once {
9392
$SVN::_Core::SVN_CONFIG_SECTION_AUTH,
9493
$SVN::_Core::SVN_CONFIG_OPTION_STORE_PASSWORDS,
9594
1) == 0) {
95+
my $val = '1';
96+
if (::compare_svn_version('1.9.0') < 0) { # pre-SVN r1553823
97+
my $dont_store_passwords = 1;
98+
$val = bless \$dont_store_passwords, "_p_void";
99+
}
96100
SVN::_Core::svn_auth_set_parameter($baton,
97101
$SVN::_Core::SVN_AUTH_PARAM_DONT_STORE_PASSWORDS,
98-
bless (\$dont_store_passwords, "_p_void"));
102+
$val);
99103
}
100104
if (SVN::_Core::svn_config_get_bool($conf_t,
101105
$SVN::_Core::SVN_CONFIG_SECTION_AUTH,

0 commit comments

Comments
 (0)