You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@manifoldcf.apache.org by kw...@apache.org on 2019/04/24 17:47:44 UTC
svn commit: r1858066 - in /manifoldcf/trunk: ./ connectors/jcifs/
connectors/jcifs/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharedrive/
connectors/jcifs/lib-proprietary/
Author: kwright
Date: Wed Apr 24 17:47:44 2019
New Revision: 1858066
URL: http://svn.apache.org/viewvc?rev=1858066&view=rev
Log:
Fix for CONNECTORS-1448.
Modified:
manifoldcf/trunk/ (props changed)
manifoldcf/trunk/CHANGES.txt
manifoldcf/trunk/connectors/jcifs/build.xml
manifoldcf/trunk/connectors/jcifs/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharedrive/SharedDriveConnector.java
manifoldcf/trunk/connectors/jcifs/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharedrive/SharedDriveHelpers.java
manifoldcf/trunk/connectors/jcifs/lib-proprietary/README.txt
manifoldcf/trunk/connectors/jcifs/pom.xml
manifoldcf/trunk/connectors/jcifs/proprietary-library-instructions.txt
Propchange: manifoldcf/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Apr 24 17:47:44 2019
@@ -80,6 +80,7 @@
/manifoldcf/branches/CONNECTORS-1425:1794719-1794944
/manifoldcf/branches/CONNECTORS-1468:1812793,1812830,1812903,1812905,1812909
/manifoldcf/branches/CONNECTORS-1490:1837603-1837874
+/manifoldcf/branches/CONNECTORS-1498:1857776-1858065
/manifoldcf/branches/CONNECTORS-1500:1827007-1827087
/manifoldcf/branches/CONNECTORS-470:1349741-1360750,1360808
/manifoldcf/branches/CONNECTORS-474:1349741-1353803
Modified: manifoldcf/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/CHANGES.txt?rev=1858066&r1=1858065&r2=1858066&view=diff
==============================================================================
--- manifoldcf/trunk/CHANGES.txt (original)
+++ manifoldcf/trunk/CHANGES.txt Wed Apr 24 17:47:44 2019
@@ -6,6 +6,9 @@ $Id$
======================= Release 2.13 =====================
+CONNECTORS-1498: Redevelop the jcifs connector to use the newer jcifs-ng.jar.
+(Karl Wright)
+
CONNECTORS-1588: Apply override of jcifs properties only if they are not
already specified.
(Cihad Guzel)
Modified: manifoldcf/trunk/connectors/jcifs/build.xml
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/jcifs/build.xml?rev=1858066&r1=1858065&r2=1858066&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/jcifs/build.xml (original)
+++ manifoldcf/trunk/connectors/jcifs/build.xml Wed Apr 24 17:47:44 2019
@@ -30,17 +30,21 @@
<import file="${mcf-dist}/connector-build.xml"/>
- <property name="jcifs.version" value="1.3.18.3"/>
+ <property name="jcifs-ng.version" value="2.1.2"/>
+
+ <!--groupId>eu.agno3.jcifs</groupId>
+ <artifactId>jcifs-ng</artifactId>
+ <version>2.1.2</version/-->
<target name="calculate-condition">
- <available file="lib-proprietary/jcifs-${jcifs.version}.jar" property="jcifsStatus"/>
+ <available file="lib-proprietary/jcifs-ng-${jcifs-ng.version}.jar" property="jcifsStatus"/>
<condition property="build-present">
<isset property="jcifsStatus"/>
</condition>
</target>
<target name="precompile-warn" depends="calculate-condition" unless="build-present">
- <echo message="JCifs Connector cannot be built without jcifs.jar"/>
+ <echo message="JCifs Connector cannot be built without jcifs-ng.jar"/>
</target>
<path id="connector-classpath">
@@ -57,10 +61,10 @@
<target name="download-jcifs">
<antcall target="download-via-maven">
- <param name="project-path" value="org/codelibs"/>
- <param name="artifact-version" value="${jcifs.version}"/>
+ <param name="project-path" value="eu/agno3/jcifs"/>
+ <param name="artifact-version" value="${jcifs-ng.version}"/>
<param name="target" value="lib-proprietary"/>
- <param name="artifact-name" value="jcifs"/>
+ <param name="artifact-name" value="jcifs-ng"/>
<param name="artifact-type" value="jar"/>
</antcall>
</target>
Modified: manifoldcf/trunk/connectors/jcifs/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharedrive/SharedDriveConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/jcifs/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharedrive/SharedDriveConnector.java?rev=1858066&r1=1858065&r2=1858066&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/jcifs/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharedrive/SharedDriveConnector.java (original)
+++ manifoldcf/trunk/connectors/jcifs/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharedrive/SharedDriveConnector.java Wed Apr 24 17:47:44 2019
@@ -16,11 +16,12 @@
*/
package org.apache.manifoldcf.crawler.connectors.sharedrive;
-import jcifs.smb.ACE;
-import jcifs.smb.NtlmPasswordAuthentication;
+import jcifs.ACE;
+import jcifs.smb.NtlmPasswordAuthenticator;
import jcifs.smb.SmbException;
import jcifs.smb.SmbFile;
import jcifs.smb.SmbFileFilter;
+import jcifs.context.SingletonContext;
import org.apache.manifoldcf.agents.interfaces.RepositoryDocument;
import org.apache.manifoldcf.agents.interfaces.ServiceInterruption;
import org.apache.manifoldcf.connectorcommon.extmimemap.ExtensionMimeMap;
@@ -113,7 +114,18 @@ public class SharedDriveConnector extend
if (System.getProperty("jcifs.smb.client.responseTimeout") == null) {
System.setProperty("jcifs.smb.client.responseTimeout","120000");
}
-
+ if (System.getProperty("jcifs.smb.client.minVersion") == null) {
+ System.setProperty("jcifs.smb.client.minVersion","SMB1");
+ }
+ if (System.getProperty("jcifs.smb.client.maxVersion") == null) {
+ System.setProperty("jcifs.smb.client.maxVersion","SMB210");
+ }
+ if (System.getProperty("jcifs.traceResources") == null) {
+ System.setProperty("jcifs.traceResources","true");
+ }
+ if (System.getProperty("jcifs.smb.client.ipcSigningEnforced") == null) {
+ System.setProperty("jcifs.smb.client.ipcSigningEnforced","true");
+ }
// Don't change these!!
System.setProperty("jcifs.smb.client.listCount","20");
System.setProperty("jcifs.smb.client.dfs.strictView","true");
@@ -127,7 +139,7 @@ public class SharedDriveConnector extend
private boolean useSIDs = true;
private String binName = null;
- private NtlmPasswordAuthentication pa;
+ private NtlmPasswordAuthenticator pa;
/** Deny access token for default authority */
private final static String defaultAuthorityDenyToken = GLOBAL_DENY_TOKEN;
@@ -182,8 +194,8 @@ public class SharedDriveConnector extend
try
{
// use NtlmPasswordAuthentication so that we can reuse credential for DFS support
- pa = new NtlmPasswordAuthentication(domain,username,password);
- SmbFile smbconnection = new SmbFile("smb://" + server + "/",pa);
+ pa = new NtlmPasswordAuthenticator(domain,username,password);
+ SmbFile smbconnection = new SmbFile("smb://" + server + "/",SingletonContext.getInstance().withCredentials(pa));
smbconnectionPath = getFileCanonicalPath(smbconnection);
}
catch (MalformedURLException e)
@@ -594,7 +606,7 @@ public class SharedDriveConnector extend
try
{
- file = new SmbFile(documentIdentifier,pa);
+ file = new SmbFile(documentIdentifier,SingletonContext.getInstance().withCredentials(pa));
fileExists = fileExists(file);
// File has to exist AND have a non-null canonical path to be readable. If the canonical path is
@@ -625,7 +637,7 @@ public class SharedDriveConnector extend
// It's a file of acceptable length.
// The ability to get ACLs, list files, and an inputstream under DFS all work now.
// The SmbFile for parentFolder acls.
- SmbFile parentFolder = new SmbFile(file.getParent(),pa);
+ SmbFile parentFolder = new SmbFile(file.getParent(),SingletonContext.getInstance().withCredentials(pa));
// Compute the security information
String[] modelArray = new String[0];
@@ -1401,7 +1413,7 @@ public class SharedDriveConnector extend
SmbFile server = null;
try
{
- server = new SmbFile(serverURI,pa);
+ server = new SmbFile(serverURI,SingletonContext.getInstance().withCredentials(pa));
}
catch (MalformedURLException e1)
{
@@ -2147,7 +2159,7 @@ public class SharedDriveConnector extend
{
String smburi = smbconnectionPath;
String uri = smburi + path + "/";
- return getFileCanonicalPath(new SmbFile(uri,pa));
+ return getFileCanonicalPath(new SmbFile(uri,SingletonContext.getInstance().withCredentials(pa)));
}
// These methods allow me to experiment with cluster-mandated error handling on an entirely local level. They correspond to individual SMBFile methods.
@@ -4624,7 +4636,7 @@ public class SharedDriveConnector extend
SmbFile server = null;
try
{
- server = new SmbFile(serverURI,pa);
+ server = new SmbFile(serverURI,SingletonContext.getInstance().withCredentials(pa));
}
catch (MalformedURLException e1)
{
@@ -4665,7 +4677,7 @@ public class SharedDriveConnector extend
SmbFile currentDirectory = null;
try
{
- currentDirectory = new SmbFile(uri,pa);
+ currentDirectory = new SmbFile(uri,SingletonContext.getInstance().withCredentials(pa));
}
catch (MalformedURLException e1)
{
@@ -4734,7 +4746,7 @@ public class SharedDriveConnector extend
SmbFile currentDirectory = null;
try
{
- currentDirectory = new SmbFile(uri,pa);
+ currentDirectory = new SmbFile(uri,SingletonContext.getInstance().withCredentials(pa));
}
catch (MalformedURLException e1)
{
Modified: manifoldcf/trunk/connectors/jcifs/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharedrive/SharedDriveHelpers.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/jcifs/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharedrive/SharedDriveHelpers.java?rev=1858066&r1=1858065&r2=1858066&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/jcifs/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharedrive/SharedDriveHelpers.java (original)
+++ manifoldcf/trunk/connectors/jcifs/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharedrive/SharedDriveHelpers.java Wed Apr 24 17:47:44 2019
@@ -31,11 +31,12 @@ import java.net.URL;
import java.util.HashMap;
import java.util.Iterator;
-import jcifs.smb.ACE;
-import jcifs.smb.NtlmPasswordAuthentication;
+import jcifs.ACE;
+import jcifs.smb.NtlmPasswordAuthenticator;
import jcifs.smb.SmbException;
import jcifs.smb.SmbFile;
import jcifs.smb.SmbFileFilter;
+import jcifs.context.SingletonContext;
/** This class contains test code that is useful for performing test operations
using JCifs from the appliance. Basic operations are: addDocument, deleteDocument,
@@ -45,7 +46,7 @@ public class SharedDriveHelpers
{
public static final String _rcsid = "@(#)$Id: SharedDriveHelpers.java 988245 2010-08-23 18:39:35Z kwright $";
- private NtlmPasswordAuthentication pa;
+ private NtlmPasswordAuthenticator pa;
private SmbFile smbconnection;
/** Construct the helper and initialize the connection.
@@ -60,8 +61,8 @@ public class SharedDriveHelpers
{
// make the smb connection to the server
// use NtlmPasswordAuthentication so that we can reuse credential for DFS support
- pa = new NtlmPasswordAuthentication(userName + ":" + password);
- smbconnection = new SmbFile("smb://" + serverName + "/",pa);
+ pa = new NtlmPasswordAuthenticator(userName, password);
+ smbconnection = new SmbFile("smb://" + serverName + "/",SingletonContext.getInstance().withCredentials(pa));
}
catch (MalformedURLException e)
{
@@ -90,7 +91,7 @@ public class SharedDriveHelpers
try
{
String identifier = mapToIdentifier(targetPath);
- SmbFile file = new SmbFile(identifier,pa);
+ SmbFile file = new SmbFile(identifier,SingletonContext.getInstance().withCredentials(pa));
if (file.exists())
return targetPath;
return "";
@@ -113,7 +114,7 @@ public class SharedDriveHelpers
try
{
String identifier = mapToIdentifier(targetPath);
- SmbFile file = new SmbFile(identifier,pa);
+ SmbFile file = new SmbFile(identifier,SingletonContext.getInstance().withCredentials(pa));
// Open source file for read
InputStream is = new FileInputStream(sourceFile);
try
@@ -122,7 +123,7 @@ public class SharedDriveHelpers
if (!file.exists())
{
file.createNewFile();
- file = new SmbFile(identifier,pa);
+ file = new SmbFile(identifier,SingletonContext.getInstance().withCredentials(pa));
}
OutputStream os = file.getOutputStream();
try
@@ -164,7 +165,7 @@ public class SharedDriveHelpers
try
{
String identifier = mapToIdentifier(targetPath);
- SmbFile file = new SmbFile(identifier,pa);
+ SmbFile file = new SmbFile(identifier,SingletonContext.getInstance().withCredentials(pa));
file.delete();
}
catch (IOException e)
@@ -202,7 +203,7 @@ public class SharedDriveHelpers
{
String smburi = smbconnection.getCanonicalPath();
String uri = smburi + path + "/";
- return new SmbFile(uri,pa).getCanonicalPath();
+ return new SmbFile(uri,SingletonContext.getInstance().withCredentials(pa)).getCanonicalPath();
}
}
Modified: manifoldcf/trunk/connectors/jcifs/lib-proprietary/README.txt
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/jcifs/lib-proprietary/README.txt?rev=1858066&r1=1858065&r2=1858066&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/jcifs/lib-proprietary/README.txt (original)
+++ manifoldcf/trunk/connectors/jcifs/lib-proprietary/README.txt Wed Apr 24 17:47:44 2019
@@ -13,12 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-For the jcifs connector, certain changes were made to jcifs itself to work reliably
-with Samba systems. This set of upstream changes is encapsulated in the following file:
-
-jcifs.diffs, against version 1.3.9 as downloaded from http://jcifs.samba.org.
-
-To build this connector, copy the jcifs.jar into this directory, and build the connector
+To build this connector, copy the jcifs-ng.jar into this directory, and build the connector
using the standard ant build. You can read more about the process on the
"how-to-build-and-deploy.html" documentation page.
Modified: manifoldcf/trunk/connectors/jcifs/pom.xml
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/jcifs/pom.xml?rev=1858066&r1=1858065&r2=1858066&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/jcifs/pom.xml (original)
+++ manifoldcf/trunk/connectors/jcifs/pom.xml Wed Apr 24 17:47:44 2019
@@ -203,12 +203,10 @@
<artifactId>mcf-ui-core</artifactId>
<version>${project.version}</version>
</dependency>
- <!-- try installing manually from http://jcifs.samba.org if not available
- in your repository -->
<dependency>
- <groupId>org.codelibs</groupId>
- <artifactId>jcifs</artifactId>
- <version>1.3.18.3</version>
+ <groupId>eu.agno3.jcifs</groupId>
+ <artifactId>jcifs-ng</artifactId>
+ <version>2.1.2</version/>
</dependency>
<!-- Testing dependencies -->
Modified: manifoldcf/trunk/connectors/jcifs/proprietary-library-instructions.txt
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/jcifs/proprietary-library-instructions.txt?rev=1858066&r1=1858065&r2=1858066&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/jcifs/proprietary-library-instructions.txt (original)
+++ manifoldcf/trunk/connectors/jcifs/proprietary-library-instructions.txt Wed Apr 24 17:47:44 2019
@@ -13,13 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-For the jcifs connector, certain changes were made to jcifs itself to
-work reliably with Samba systems. This set of upstream changes is
-encapsulated in the following file:
-
-jcifs.diffs, against version 1.3.9 as downloaded from http://jcifs.samba.org.
-
-To run this connector, copy the jcifs.jar into this directory, and run
+To run this connector, copy the jcifs-ng.jar into this directory, and run
ManifoldCF in the normal way. You can read more about the
process on the "how-to-build-and-deploy.html" documentation page.