incubator-connectors-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r939304 - /incubator/lcf/trunk/modules/connectors/jcifs/connector/org/apache/lcf/crawler/connectors/sharedrive/SharedDriveConnector.java
Date Thu, 29 Apr 2010 13:34:51 GMT
Author: kwright
Date: Thu Apr 29 13:34:50 2010
New Revision: 939304

URL: http://svn.apache.org/viewvc?rev=939304&view=rev
Log:
Fix for CONNECTORS-29.  Use the non-escaped authentication method in JCIFS.

Modified:
    incubator/lcf/trunk/modules/connectors/jcifs/connector/org/apache/lcf/crawler/connectors/sharedrive/SharedDriveConnector.java

Modified: incubator/lcf/trunk/modules/connectors/jcifs/connector/org/apache/lcf/crawler/connectors/sharedrive/SharedDriveConnector.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/connectors/jcifs/connector/org/apache/lcf/crawler/connectors/sharedrive/SharedDriveConnector.java?rev=939304&r1=939303&r2=939304&view=diff
==============================================================================
--- incubator/lcf/trunk/modules/connectors/jcifs/connector/org/apache/lcf/crawler/connectors/sharedrive/SharedDriveConnector.java
(original)
+++ incubator/lcf/trunk/modules/connectors/jcifs/connector/org/apache/lcf/crawler/connectors/sharedrive/SharedDriveConnector.java
Thu Apr 29 13:34:50 2010
@@ -114,23 +114,21 @@ public class SharedDriveConnector extend
       // make the smb connection to the server
       String authenticationString;
       if (domain == null || domain.length() == 0)
-        authenticationString = username + ":" + password;
-      else
-        authenticationString = domain + ";" + username + ":" + password;
-
+        domain = null;
+      
       if (Logging.connectors.isDebugEnabled())
-        Logging.connectors.debug("Connecting to: " + "smb://" + authenticationString.substring(0,authenticationString.indexOf(":")+1)
+ "<password>@" + server + "/");
+        Logging.connectors.debug("Connecting to: " + "smb://" + ((domain==null)?"":domain)+";"+username+":<password>@"
+ server + "/");
 
       try
       {
         // use NtlmPasswordAuthentication so that we can reuse credential for DFS support
-        pa = new NtlmPasswordAuthentication(authenticationString);
+        pa = new NtlmPasswordAuthentication(domain,username,password);
         SmbFile smbconnection = new SmbFile("smb://" + server + "/",pa);
         smbconnectionPath = getFileCanonicalPath(smbconnection);
       }
       catch (MalformedURLException e)
       {
-        Logging.connectors.error("Unable to access SMB/CIFS share: "+"smb://" + authenticationString.substring(0,authenticationString.indexOf(":")+1)
+ "<password>@" + server + "/\n" + e);
+        Logging.connectors.error("Unable to access SMB/CIFS share: "+"smb://" + ((domain==null)?"":domain)+";"+username+":<password>@"+
server + "/\n" + e);
         throw new LCFException("Unable to access SMB/CIFS share: "+server, e, LCFException.REPOSITORY_CONNECTION_ERROR);
       }
     }



Mime
View raw message