{"thread":{"id":"41207","subject":"[PATCH] git-svn: fix auth parameter handling on SVN 1.9.0+","startedAt":"2016-01-16T10:17:19Z","lastAt":"2016-01-16T14:00:36Z","messageCount":2,"participants":["Eric Wong","Thierry Vignaud"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"276226","messageId":"20160116101719.GA21147@dcvr.yhbt.net","threadId":"41207","inReplyTo":null,"subject":"[PATCH] git-svn: fix auth parameter handling on SVN 1.9.0+","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2016-01-16T10:17:19Z","receivedAt":"2016-01-16T10:17:19Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"For users with \"store-passwords = no\" set in the \"[auth]\" section of\ntheir ~/.subversion/config, SVN 1.9.0+ would fail with the\nfollowing message when attempting to call svn_auth_set_parameter:\n\n  Value is not a string (or undef) at Git/SVN/Ra.pm\n\nIronically, this breakage was caused by r1553823 in subversion:\n\n  \"Make svn_auth_set_parameter() usable from Perl bindings.\"\n\nSince 2007 (602015e0e6ec), git-svn has used a workaround to make\nsvn_auth_set_parameter usable internally.  However this workaround\nbreaks under SVN 1.9+, which deals properly with the type mapping\nand fails to recognize our workaround.\n\nFor pre-1.9.0 SVN, we continue to use the existing workaround for\nthe lack of proper type mapping in the bindings.\n\nTested under subversion 1.6.17 and 1.9.3.\n\nI've also verified r1553823 was not backported to SVN 1.8.x:\n\n  BRANCH=http://svn.apache.org/repos/asf/subversion/branches/1.8.x\n  svn log -v $BRANCH/subversion/bindings/swig/core.i\n\nref: https://bugs.debian.org/797705\nCc: 797705@bugs.debian.org\nSigned-off-by: Eric Wong <normalperson@yhbt.net>\n---\n Thanks to the reporter (Bcc:-ed to protect their privacy) who\n notified Dair and I of this bug.\n\n Junio: this should also head to maint, thanks.\n\n perl/Git/SVN/Ra.pm | 8 ++++++--\n 1 file changed, 6 insertions(+), 2 deletions(-)\n\ndiff --git a/perl/Git/SVN/Ra.pm b/perl/Git/SVN/Ra.pm\nindex 4a499fc..e764696 100644\n--- a/perl/Git/SVN/Ra.pm\n+++ b/perl/Git/SVN/Ra.pm\n@@ -81,7 +81,6 @@ sub prepare_config_once {\n \tSVN::_Core::svn_config_ensure($config_dir, undef);\n \tmy ($baton, $callbacks) = SVN::Core::auth_open_helper(_auth_providers);\n \tmy $config = SVN::Core::config_get_config($config_dir);\n-\tmy $dont_store_passwords = 1;\n \tmy $conf_t = $config->{'config'};\n \n \tno warnings 'once';\n@@ -93,9 +92,14 @@ sub prepare_config_once {\n \t    $SVN::_Core::SVN_CONFIG_SECTION_AUTH,\n \t    $SVN::_Core::SVN_CONFIG_OPTION_STORE_PASSWORDS,\n \t    1) == 0) {\n+\t\tmy $val = '1';\n+\t\tif (::compare_svn_version('1.9.0') < 0) { # pre-SVN r1553823\n+\t\t\tmy $dont_store_passwords = 1;\n+\t\t\t$val = bless \\$dont_store_passwords, \"_p_void\";\n+\t\t}\n \t\tSVN::_Core::svn_auth_set_parameter($baton,\n \t\t    $SVN::_Core::SVN_AUTH_PARAM_DONT_STORE_PASSWORDS,\n-\t\t    bless (\\$dont_store_passwords, \"_p_void\"));\n+\t\t    $val);\n \t}\n \tif (SVN::_Core::svn_config_get_bool($conf_t,\n \t    $SVN::_Core::SVN_CONFIG_SECTION_AUTH,\n-- \nEW\n"},{"id":"276228","messageId":"CAONrEtbEVwP8VxdYgar5oDtK4q94f5L_nAtFokSo8vVnp0ixog@mail.gmail.com","threadId":"41207","inReplyTo":"20160116101719.GA21147@dcvr.yhbt.net","subject":"Re: [PATCH] git-svn: fix auth parameter handling on SVN 1.9.0+","fromName":"Thierry Vignaud","fromEmail":"thierry.vignaud@gmail.com","sentAt":"2016-01-16T14:00:36Z","receivedAt":"2016-01-16T14:00:36Z","isPatch":true,"sender":{"key":"thierry.vignaud@gmail.com","avatar":null},"body":"On 16 January 2016 at 11:17, Eric Wong <normalperson@yhbt.net> wrote:\n> For users with \"store-passwords = no\" set in the \"[auth]\" section of\n> their ~/.subversion/config, SVN 1.9.0+ would fail with the\n> following message when attempting to call svn_auth_set_parameter:\n>\n>   Value is not a string (or undef) at Git/SVN/Ra.pm\n>\n> Ironically, this breakage was caused by r1553823 in subversion:\n>\n>   \"Make svn_auth_set_parameter() usable from Perl bindings.\"\n>\n> Since 2007 (602015e0e6ec), git-svn has used a workaround to make\n> svn_auth_set_parameter usable internally.  However this workaround\n> breaks under SVN 1.9+, which deals properly with the type mapping\n> and fails to recognize our workaround.\n>\n> For pre-1.9.0 SVN, we continue to use the existing workaround for\n> the lack of proper type mapping in the bindings.\n>\n> Tested under subversion 1.6.17 and 1.9.3.\n>\n> I've also verified r1553823 was not backported to SVN 1.8.x:\n>\n>   BRANCH=http://svn.apache.org/repos/asf/subversion/branches/1.8.x\n>   svn log -v $BRANCH/subversion/bindings/swig/core.i\n>\n> ref: https://bugs.debian.org/797705\n> Cc: 797705@bugs.debian.org\n> Signed-off-by: Eric Wong <normalperson@yhbt.net>\n> ---\n>  Thanks to the reporter (Bcc:-ed to protect their privacy) who\n>  notified Dair and I of this bug.\n>\n>  Junio: this should also head to maint, thanks.\n\nThanks, I confirm it fixed the issue.\nYou can add the following if you want:\n\nReported-by: Thierry Vignaud <thierry.vignaud@gmail.com>\nTested-by: Thierry Vignaud <thierry.vignaud@gmail.com>\n"}]}