subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hwri...@apache.org
Subject svn commit: r1183054 - /subversion/trunk/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNClient.java
Date Thu, 13 Oct 2011 19:56:48 GMT
Author: hwright
Date: Thu Oct 13 19:56:48 2011
New Revision: 1183054

URL: http://svn.apache.org/viewvc?rev=1183054&view=rev
Log:
JavaHL: Fix a potential infinite recurssion bug in the JavaHL compat layer.

* subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNClient.java
  (PromptUser1Wrapper): Don't infinite recurse on the askTrustSSLServer method,
    by storing and using the appropriate version of the interface.

Modified:
    subversion/trunk/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNClient.java

Modified: subversion/trunk/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNClient.java
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNClient.java?rev=1183054&r1=1183053&r2=1183054&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNClient.java
(original)
+++ subversion/trunk/subversion/bindings/javahl/src/org/tigris/subversion/javahl/SVNClient.java
Thu Oct 13 19:56:48 2011
@@ -324,10 +324,20 @@ public class SVNClient implements SVNCli
         implements org.apache.subversion.javahl.callback.UserPasswordCallback
     {
         PromptUserPassword oldPrompt;
+        PromptUserPassword2 oldPrompt2;
+        PromptUserPassword3 oldPrompt3;
 
         PromptUser1Wrapper(PromptUserPassword prompt)
         {
             oldPrompt = prompt;
+
+            /* This mirrors the insanity that was going on in the C++ layer
+               prior to 1.7.  Don't ask, just pray it works. */
+            if (prompt instanceof PromptUserPassword2)
+              oldPrompt2 = (PromptUserPassword2) prompt;
+
+            if (prompt instanceof PromptUserPassword3)
+              oldPrompt3 = (PromptUserPassword3) prompt;
         }
 
         public String getPassword()
@@ -359,7 +369,10 @@ public class SVNClient implements SVNCli
 
         public int askTrustSSLServer(String info, boolean allowPermanently)
         {
-            return askTrustSSLServer(info, allowPermanently);
+            if (oldPrompt2 != null)
+                return oldPrompt2.askTrustSSLServer(info, allowPermanently);
+            else
+                return 0;
         }
 
         public boolean userAllowedSave()



Mime
View raw message