manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1384620 - in /manifoldcf/trunk: ./ connectors/jcifs/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharedrive/ connectors/jcifs/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/sharedrive/ connecto...
Date Fri, 14 Sep 2012 01:12:52 GMT
Author: kwright
Date: Fri Sep 14 01:12:52 2012
New Revision: 1384620

URL: http://svn.apache.org/viewvc?rev=1384620&view=rev
Log:
Add LDAP connector, and modify JCIFS connector to allow account names to be used instead of
SIDs, if desired.  Thanks to Maciej Lizewski for this contribution.  CONNECTORS-515.

Added:
    manifoldcf/trunk/connectors/ldap/   (props changed)
      - copied from r1384619, manifoldcf/branches/CONNECTORS-515/connectors/ldap/
Modified:
    manifoldcf/trunk/   (props changed)
    manifoldcf/trunk/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/SharedDriveParameters.java
    manifoldcf/trunk/connectors/jcifs/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/sharedrive/common_en_US.properties
    manifoldcf/trunk/connectors/jcifs/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/sharedrive/common_ja_JP.properties

Propchange: manifoldcf/trunk/
------------------------------------------------------------------------------
  Merged /manifoldcf/branches/CONNECTORS-515:r1379845-1384619

Modified: manifoldcf/trunk/build.xml
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/build.xml?rev=1384620&r1=1384619&r2=1384620&view=diff
==============================================================================
--- manifoldcf/trunk/build.xml (original)
+++ manifoldcf/trunk/build.xml Fri Sep 14 01:12:52 2012
@@ -59,6 +59,7 @@
         <ant dir="connectors/alfresco" target="clean"/>
         <ant dir="connectors/cmis" target="clean"/>
         <ant dir="connectors/activedirectory" target="clean"/>
+        <ant dir="connectors/ldap" target="clean"/>
         <ant dir="connectors/documentum" target="clean"/>
         <ant dir="connectors/filenet" target="clean"/>
         <ant dir="connectors/filesystem" target="clean"/>
@@ -108,6 +109,7 @@
         <ant dir="connectors/alfresco" target="clean"/>
         <ant dir="connectors/cmis" target="clean"/>
         <ant dir="connectors/activedirectory" target="clean"/>
+        <ant dir="connectors/ldap" target="clean"/>
         <ant dir="connectors/documentum" target="clean"/>
         <ant dir="connectors/filenet" target="clean"/>
         <ant dir="connectors/filesystem" target="clean"/>
@@ -235,7 +237,43 @@
     <target name="run-tests-HSQLDB-activedirectory-connector" depends="setup-activedirectory-connector,setup-activedirectory-connector-tests"
if="downloaded">
         <ant dir="connectors/activedirectory" target="run-tests-HSQLDB"/>
     </target>
+
+    <target name="setup-ldap-connector" depends="build-framework" if="downloaded"/>
+
+    <target name="setup-ldap-connector-tests" depends="build-tests-framework" if="downloaded"/>
+
+    <target name="build-ldap-connector" depends="setup-ldap-connector" if="downloaded">
+        <ant dir="connectors/ldap" target="build"/>
+    </target>
+
+    <target name="doc-ldap-connector" depends="setup-ldap-connector" if="downloaded">
+      <ant dir="connectors/ldap" target="doc"/>
+    </target>
     
+    <target name="build-tests-ldap-connector" depends="setup-ldap-connector,setup-ldap-connector-tests"
if="downloaded">
+        <ant dir="connectors/ldap" target="build-tests"/>
+    </target>
+
+    <target name="run-tests-ldap-connector" depends="setup-ldap-connector,setup-ldap-connector-tests"
if="downloaded">
+        <ant dir="connectors/ldap" target="run-tests"/>
+    </target>
+
+    <target name="run-tests-derby-ldap-connector" depends="setup-ldap-connector,setup-ldap-connector-tests"
if="downloaded">
+        <ant dir="connectors/ldap" target="run-tests-derby"/>
+    </target>
+
+    <target name="run-tests-postgresql-ldap-connector" depends="setup-ldap-connector,setup-ldap-connector-tests"
if="downloaded">
+        <ant dir="connectors/ldap" target="run-tests-postgresql"/>
+    </target>
+
+    <target name="run-tests-mysql-ldap-connector" depends="setup-ldap-connector,setup-ldap-connector-tests"
if="downloaded">
+        <ant dir="connectors/ldap" target="run-tests-mysql"/>
+    </target>
+
+    <target name="run-tests-HSQLDB-ldap-connector" depends="setup-ldap-connector,setup-ldap-connector-tests"
if="downloaded">
+        <ant dir="connectors/ldap" target="run-tests-HSQLDB"/>
+    </target>
+
     <target name="setup-alfresco-connector" depends="build-framework" if="downloaded"/>
 
     <target name="setup-cmis-connector" depends="build-framework" if="downloaded"/>
@@ -1228,7 +1266,44 @@
             <param name="connector-name" value="activedirectory"/>
         </antcall>
     </target>
-    
+
+    <target name="calculate-ldap-condition" depends="build-ldap-connector">
+        <available file="connectors/ldap/dist/lib" type="dir" property="ldap.exists"/>
+        <condition property="ldap.include">
+            <and>
+                <isset property="ldap.exists"/>
+                <isset property="downloaded"/>
+            </and>
+        </condition>
+    </target>
+
+    <target name="calculate-ldap-doc-condition" depends="doc-ldap-connector">
+        <available file="connectors/ldap/dist/doc" type="dir" property="ldap-doc.exists"/>
+        <condition property="ldap-doc.include">
+            <and>
+                <isset property="ldap-doc.exists"/>
+                <isset property="downloaded"/>
+            </and>
+        </condition>
+    </target>
+
+    <target name="deliver-ldap-connector" depends="calculate-ldap-condition" if="ldap.include">
+        <antcall target="general-connector-delivery">
+            <param name="connector-name" value="ldap"/>
+        </antcall>
+        <antcall target="general-add-authority-connector">
+            <param name="connector-name" value="ldap"/>
+            <param name="connector-label" value="LDAP"/>
+            <param name="connector-class" value="org.apache.manifoldcf.authorities.authorities.ldap.LDAPAuthority"/>
+        </antcall>
+    </target>
+
+    <target name="deliver-ldap-connector-doc" depends="calculate-ldap-doc-condition" if="ldap-doc.include">
+        <antcall target="general-connector-doc-delivery">
+            <param name="connector-name" value="ldap"/>
+        </antcall>
+    </target>
+
     <target name="calculate-alfresco-condition" depends="build-alfresco-connector">
         <available file="connectors/alfresco/dist/lib" type="dir" property="alfresco.exists"/>
         <condition property="alfresco.include">
@@ -2058,6 +2133,14 @@
       </condition>
     </target>
 
+    <target name="calculate-ldap-tests-condition" depends="calculate-ldap-condition">
+      <condition property="ldap-tests.include">
+        <and>
+            <isset property="ldap.include"/>
+        </and>
+      </condition>
+    </target>
+
     <target name="calculate-solr-tests-condition" depends="calculate-filesystem-condition,calculate-solr-condition">
       <condition property="solr-tests.include">
         <and>
@@ -2143,6 +2226,10 @@
         <ant dir="tests/activedirectory" target="run-UI-derby"/>
     </target>
 
+    <target name="run-ldap-UI-tests-derby" depends="build-tests-framework,build-tests-ldap-connector,calculate-ldap-tests-condition"
if="ldap-tests.include">
+        <ant dir="tests/ldap" target="run-UI-derby"/>
+    </target>
+
     <target name="run-filesystem-tests-derby" depends="build-tests-framework,build-tests-filesystem-connector,build-tests-nulloutput-connector,calculate-filesystem-tests-condition"
if="filesystem-tests.include">
         <ant dir="tests/filesystem" target="run-derby"/>
     </target>
@@ -2379,29 +2466,29 @@
         <ant dir="tests/sharepoint" target="run-load-HSQLDB"/>
     </target>
 
-    <target name="run-tests-open-connectors" depends="run-tests-activedirectory-connector,run-tests-alfresco-connector,run-tests-cmis-connector,run-tests-filesystem-connector,run-tests-nullauthority-connector,run-tests-nulloutput-connector,run-tests-rss-connector,run-tests-solr-connector,run-tests-webcrawler-connector,run-tests-wiki-connector,run-tests-jdbc-connector"/>
+    <target name="run-tests-open-connectors" depends="run-tests-activedirectory-connector,run-tests-ldap-connector,run-tests-alfresco-connector,run-tests-cmis-connector,run-tests-filesystem-connector,run-tests-nullauthority-connector,run-tests-nulloutput-connector,run-tests-rss-connector,run-tests-solr-connector,run-tests-webcrawler-connector,run-tests-wiki-connector,run-tests-jdbc-connector"/>
     <target name="run-tests-lgpl-connectors" depends="run-tests-jcifs-connector"/>
     <target name="run-tests-proprietary-connectors" depends="run-tests-documentum-connector,run-tests-filenet-connector,run-tests-livelink-connector,run-tests-memex-connector,run-tests-meridio-connector,run-tests-sharepoint-connector"/>
 
-    <target name="run-tests-derby-open-connectors" depends="run-tests-derby-activedirectory-connector,run-tests-derby-alfresco-connector,run-tests-derby-cmis-connector,run-tests-derby-filesystem-connector,run-tests-derby-nullauthority-connector,run-tests-derby-nulloutput-connector,run-tests-derby-rss-connector,run-tests-derby-solr-connector,run-tests-derby-webcrawler-connector,run-tests-derby-wiki-connector,run-tests-derby-jdbc-connector"/>
+    <target name="run-tests-derby-open-connectors" depends="run-tests-derby-activedirectory-connector,run-tests-derby-ldap-connector,run-tests-derby-alfresco-connector,run-tests-derby-cmis-connector,run-tests-derby-filesystem-connector,run-tests-derby-nullauthority-connector,run-tests-derby-nulloutput-connector,run-tests-derby-rss-connector,run-tests-derby-solr-connector,run-tests-derby-webcrawler-connector,run-tests-derby-wiki-connector,run-tests-derby-jdbc-connector"/>
     <target name="run-tests-derby-lgpl-connectors" depends="run-tests-derby-jcifs-connector"/>
     <target name="run-tests-derby-proprietary-connectors" depends="run-tests-derby-documentum-connector,run-tests-derby-filenet-connector,run-tests-derby-livelink-connector,run-tests-derby-memex-connector,run-tests-derby-meridio-connector,run-tests-derby-sharepoint-connector"/>
     
     <target name="end-to-end-tests-derby" depends="run-filesystem-tests-derby,run-wiki-tests-derby,run-alfresco-tests-derby,run-cmis-tests-derby,run-sharepoint-tests-derby"/>
 
-    <target name="run-tests-postgresql-open-connectors" depends="run-tests-postgresql-activedirectory-connector,run-tests-postgresql-alfresco-connector,run-tests-postgresql-cmis-connector,run-tests-postgresql-filesystem-connector,run-tests-postgresql-nullauthority-connector,run-tests-postgresql-nulloutput-connector,run-tests-postgresql-rss-connector,run-tests-postgresql-solr-connector,run-tests-postgresql-webcrawler-connector,run-tests-postgresql-wiki-connector,run-tests-postgresql-jdbc-connector,run-tests-postgresql-opensearchserver-connector,run-tests-postgresql-elasticsearch-connector"/>
+    <target name="run-tests-postgresql-open-connectors" depends="run-tests-postgresql-activedirectory-connector,run-tests-postgresql-ldap-connector,run-tests-postgresql-alfresco-connector,run-tests-postgresql-cmis-connector,run-tests-postgresql-filesystem-connector,run-tests-postgresql-nullauthority-connector,run-tests-postgresql-nulloutput-connector,run-tests-postgresql-rss-connector,run-tests-postgresql-solr-connector,run-tests-postgresql-webcrawler-connector,run-tests-postgresql-wiki-connector,run-tests-postgresql-jdbc-connector,run-tests-postgresql-opensearchserver-connector,run-tests-postgresql-elasticsearch-connector"/>
     <target name="run-tests-postgresql-lgpl-connectors" depends="run-tests-postgresql-jcifs-connector"/>
     <target name="run-tests-postgresql-proprietary-connectors" depends="run-tests-postgresql-documentum-connector,run-tests-postgresql-filenet-connector,run-tests-postgresql-livelink-connector,run-tests-postgresql-memex-connector,run-tests-postgresql-meridio-connector,run-tests-postgresql-sharepoint-connector"/>
     
     <target name="end-to-end-tests-postgresql" depends="run-filesystem-tests-postgresql,run-wiki-tests-postgresql,run-alfresco-tests-postgresql,run-cmis-tests-postgresql,run-sharepoint-tests-postgresql"/>
 
-    <target name="run-tests-mysql-open-connectors" depends="run-tests-mysql-activedirectory-connector,run-tests-mysql-alfresco-connector,run-tests-mysql-cmis-connector,run-tests-mysql-filesystem-connector,run-tests-mysql-nullauthority-connector,run-tests-mysql-nulloutput-connector,run-tests-mysql-rss-connector,run-tests-mysql-solr-connector,run-tests-mysql-webcrawler-connector,run-tests-mysql-wiki-connector,run-tests-mysql-jdbc-connector,run-tests-mysql-opensearchserver-connector,run-tests-mysql-elasticsearch-connector"/>
+    <target name="run-tests-mysql-open-connectors" depends="run-tests-mysql-activedirectory-connector,run-tests-mysql-ldap-connector,run-tests-mysql-alfresco-connector,run-tests-mysql-cmis-connector,run-tests-mysql-filesystem-connector,run-tests-mysql-nullauthority-connector,run-tests-mysql-nulloutput-connector,run-tests-mysql-rss-connector,run-tests-mysql-solr-connector,run-tests-mysql-webcrawler-connector,run-tests-mysql-wiki-connector,run-tests-mysql-jdbc-connector,run-tests-mysql-opensearchserver-connector,run-tests-mysql-elasticsearch-connector"/>
     <target name="run-tests-mysql-lgpl-connectors" depends="run-tests-mysql-jcifs-connector"/>
     <target name="run-tests-mysql-proprietary-connectors" depends="run-tests-mysql-documentum-connector,run-tests-mysql-filenet-connector,run-tests-mysql-livelink-connector,run-tests-mysql-memex-connector,run-tests-mysql-meridio-connector,run-tests-mysql-sharepoint-connector"/>
     
     <target name="end-to-end-tests-mysql" depends="run-filesystem-tests-mysql,run-wiki-tests-mysql,run-alfresco-tests-mysql,run-cmis-tests-mysql,run-sharepoint-tests-mysql"/>
 
-    <target name="run-tests-HSQLDB-open-connectors" depends="run-tests-HSQLDB-activedirectory-connector,run-tests-HSQLDB-alfresco-connector,run-tests-HSQLDB-cmis-connector,run-tests-HSQLDB-filesystem-connector,run-tests-HSQLDB-nullauthority-connector,run-tests-HSQLDB-nulloutput-connector,run-tests-HSQLDB-rss-connector,run-tests-HSQLDB-solr-connector,run-tests-HSQLDB-webcrawler-connector,run-tests-HSQLDB-wiki-connector,run-tests-HSQLDB-jdbc-connector,run-tests-HSQLDB-opensearchserver-connector,run-tests-HSQLDB-elasticsearch-connector"/>
+    <target name="run-tests-HSQLDB-open-connectors" depends="run-tests-HSQLDB-activedirectory-connector,run-tests-HSQLDB-ldap-connector,run-tests-HSQLDB-alfresco-connector,run-tests-HSQLDB-cmis-connector,run-tests-HSQLDB-filesystem-connector,run-tests-HSQLDB-nullauthority-connector,run-tests-HSQLDB-nulloutput-connector,run-tests-HSQLDB-rss-connector,run-tests-HSQLDB-solr-connector,run-tests-HSQLDB-webcrawler-connector,run-tests-HSQLDB-wiki-connector,run-tests-HSQLDB-jdbc-connector,run-tests-HSQLDB-opensearchserver-connector,run-tests-HSQLDB-elasticsearch-connector"/>
     <target name="run-tests-HSQLDB-lgpl-connectors" depends="run-tests-HSQLDB-jcifs-connector"/>
     <target name="run-tests-HSQLDB-proprietary-connectors" depends="run-tests-HSQLDB-documentum-connector,run-tests-HSQLDB-filenet-connector,run-tests-HSQLDB-livelink-connector,run-tests-HSQLDB-memex-connector,run-tests-HSQLDB-meridio-connector,run-tests-HSQLDB-sharepoint-connector"/>
     
@@ -2416,8 +2503,8 @@
     <target name="end-to-end-loadtests-HSQLDB" depends="run-filesystem-loadtests-HSQLDB,run-rss-loadtests-HSQLDB,run-wiki-loadtests-HSQLDB,run-alfresco-loadtests-HSQLDB,run-cmis-loadtests-HSQLDB,run-sharepoint-loadtests-HSQLDB"/>
 
 
-    <target name="deliver-open-connectors" depends="deliver-nullauthority-connector,deliver-activedirectory-connector,deliver-alfresco-connector,deliver-cmis-connector,deliver-filesystem-connector,deliver-rss-connector,deliver-webcrawler-connector,deliver-wiki-connector,deliver-jdbc-connector"/>
-    <target name="deliver-open-connectors-doc" depends="deliver-nullauthority-connector-doc,deliver-activedirectory-connector-doc,deliver-alfresco-connector-doc,deliver-cmis-connector-doc,deliver-filesystem-connector-doc,deliver-rss-connector-doc,deliver-webcrawler-connector-doc,deliver-wiki-connector-doc,deliver-jdbc-connector-doc"/>
+    <target name="deliver-open-connectors" depends="deliver-nullauthority-connector,deliver-activedirectory-connector,deliver-ldap-connector,deliver-alfresco-connector,deliver-cmis-connector,deliver-filesystem-connector,deliver-rss-connector,deliver-webcrawler-connector,deliver-wiki-connector,deliver-jdbc-connector"/>
+    <target name="deliver-open-connectors-doc" depends="deliver-nullauthority-connector-doc,deliver-activedirectory-connector-doc,deliver-ldap-connector-doc,deliver-alfresco-connector-doc,deliver-cmis-connector-doc,deliver-filesystem-connector-doc,deliver-rss-connector-doc,deliver-webcrawler-connector-doc,deliver-wiki-connector-doc,deliver-jdbc-connector-doc"/>
     
     <target name="deliver-output-connectors" depends="deliver-gts-connector,deliver-solr-connector,deliver-nulloutput-connector,deliver-opensearchserver-connector,deliver-elasticsearch-connector"/>
     <target name="deliver-output-connectors-doc" depends="deliver-gts-connector-doc,deliver-solr-connector-doc,deliver-nulloutput-connector-doc,deliver-opensearchserver-connector-doc,deliver-elasticsearch-connector-doc"/>
@@ -2564,7 +2651,7 @@
 
     <target name="ldtest" depends="load-dr,load-hs"/>
 
-    <target name="uitest" depends="run-filesystem-UI-tests-derby,run-jcifs-UI-tests-derby,run-jdbc-UI-tests-derby,run-activedirectory-UI-tests-derby,run-rss-UI-tests-derby,run-webcrawler-UI-tests-derby,run-wiki-UI-tests-derby,run-solr-UI-tests-derby,run-cmis-UI-tests-derby,run-gts-UI-tests-derby,run-opensearchserver-UI-tests-derby"/>
+    <target name="uitest" depends="run-filesystem-UI-tests-derby,run-jcifs-UI-tests-derby,run-jdbc-UI-tests-derby,run-activedirectory-UI-tests-derby,run-ldap-UI-tests-derby,run-rss-UI-tests-derby,run-webcrawler-UI-tests-derby,run-wiki-UI-tests-derby,run-solr-UI-tests-derby,run-cmis-UI-tests-derby,run-gts-UI-tests-derby,run-opensearchserver-UI-tests-derby"/>
     
     <target name="all" depends="build,javadoc,doc,image,test-dr,test-hs"/>
 
@@ -3471,6 +3558,7 @@ Use Apache Forrest version forrest-0.9-d
         <ant dir="connectors/alfresco" target="download-dependencies"/>
         <ant dir="connectors/cmis" target="download-dependencies"/>
         <ant dir="connectors/activedirectory" target="download-dependencies"/>
+        <ant dir="connectors/ldap" target="download-dependencies"/>
         <ant dir="connectors/documentum" target="download-dependencies"/>
         <ant dir="connectors/filenet" target="download-dependencies"/>
         <ant dir="connectors/filesystem" target="download-dependencies"/>
@@ -3506,6 +3594,7 @@ Use Apache Forrest version forrest-0.9-d
         <ant dir="connectors/alfresco" target="download-cleanup"/>
         <ant dir="connectors/cmis" target="download-cleanup"/>
         <ant dir="connectors/activedirectory" target="download-cleanup"/>
+        <ant dir="connectors/ldap" target="download-cleanup"/>
         <ant dir="connectors/documentum" target="download-cleanup"/>
         <ant dir="connectors/filenet" target="download-cleanup"/>
         <ant dir="connectors/filesystem" target="download-cleanup"/>

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=1384620&r1=1384619&r2=1384620&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
Fri Sep 14 01:12:52 2012
@@ -114,6 +114,7 @@ public class SharedDriveConnector extend
   private String domain = null;
   private String username = null;
   private String password = null;
+  private boolean useSIDs = true;
 
   private NtlmPasswordAuthentication pa;
 
@@ -213,6 +214,10 @@ public class SharedDriveConnector extend
     password = configParameters.getObfuscatedParameter(SharedDriveParameters.password);
     if (password == null)
       password = "";
+    String useSIDsString = configParameters.getParameter(SharedDriveParameters.useSIDs);
+    if (useSIDsString == null)
+      useSIDsString = "true";
+    useSIDs = "true".equals(useSIDsString);
 
     // Rejigger the username/domain to be sure we PASS in a domain and we do not include
the domain attached to the user!
     // (This became essential at jcifs 1.3.0)
@@ -1002,7 +1007,7 @@ public class SharedDriveConnector extend
 
 
         // Grab the share permissions.
-        aces = getFileShareSecurity(file);
+        aces = getFileShareSecurity(file, useSIDs);
 
         if (aces == null)
         {
@@ -1047,9 +1052,9 @@ public class SharedDriveConnector extend
             if ((ace.getAccessMask() & ACE.FILE_READ_DATA) != 0)
             {
               if (ace.isAllow())
-                shareAllowAcls[allowCount++] = ace.getSID().toString();
+                shareAllowAcls[allowCount++] = useSIDs ? ace.getSID().toString() : ace.getSID().getAccountName();
               else
-                shareDenyAcls[denyCount++] = ace.getSID().toString();
+                shareDenyAcls[denyCount++] = useSIDs ? ace.getSID().toString() : ace.getSID().getAccountName();
             }
           }
         }
@@ -1077,7 +1082,7 @@ public class SharedDriveConnector extend
 
       if (forcedacls.length==0)
       {
-        aces = getFileSecurity(file);
+        aces = getFileSecurity(file, useSIDs);
         if (aces == null)
         {
           if (Logging.connectors.isDebugEnabled())
@@ -1121,9 +1126,9 @@ public class SharedDriveConnector extend
             if ((ace.getAccessMask() & ACE.FILE_READ_DATA) != 0)
             {
               if (ace.isAllow())
-                allowAcls[allowCount++] = ace.getSID().toString();
+                allowAcls[allowCount++] = useSIDs ? ace.getSID().toString() : ace.getSID().getAccountName();
               else
-                denyAcls[denyCount++] = ace.getSID().toString();
+                denyAcls[denyCount++] = useSIDs ? ace.getSID().toString() : ace.getSID().getAccountName();
             }
           }
         }
@@ -2298,7 +2303,7 @@ public class SharedDriveConnector extend
   }
 
   /** Get file security */
-  protected static ACE[] getFileSecurity(SmbFile file)
+  protected static ACE[] getFileSecurity(SmbFile file, boolean useSIDs)
     throws IOException
   {
     int totalTries = 0;
@@ -2310,7 +2315,7 @@ public class SharedDriveConnector extend
       totalTries++;
       try
       {
-        return file.getSecurity(false);
+        return file.getSecurity(!useSIDs);
       }
       catch (java.net.SocketTimeoutException e)
       {
@@ -2336,7 +2341,7 @@ public class SharedDriveConnector extend
   }
 
   /** Get share security */
-  protected static ACE[] getFileShareSecurity(SmbFile file)
+  protected static ACE[] getFileShareSecurity(SmbFile file, boolean useSIDs)
     throws IOException
   {
     int totalTries = 0;
@@ -2348,7 +2353,7 @@ public class SharedDriveConnector extend
       totalTries++;
       try
       {
-        return file.getShareSecurity(false);
+        return file.getShareSecurity(!useSIDs);
       }
       catch (java.net.SocketTimeoutException e)
       {
@@ -2601,6 +2606,8 @@ public class SharedDriveConnector extend
     if (username==null) username = "";
     String password = parameters.getObfuscatedParameter(org.apache.manifoldcf.crawler.connectors.sharedrive.SharedDriveParameters.password);
     if (password==null) password = "";
+    String resolvesids = parameters.getParameter(org.apache.manifoldcf.crawler.connectors.sharedrive.SharedDriveParameters.useSIDs);
+    if (resolvesids==null) resolvesids = "true";
 
     // "Server" tab
     if (tabName.equals(Messages.getString(locale,"SharedDriveConnector.Server")))
@@ -2624,6 +2631,11 @@ public class SharedDriveConnector extend
 "    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"SharedDriveConnector.Password")
+ "</nobr></td>\n"+
 "    <td class=\"value\"><input type=\"password\" size=\"32\" name=\"password\"
value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(password)+"\"/></td>\n"+
 "  </tr>\n"+
+"  <tr><td class=\"separator\" colspan=\"2\"><hr/></td></tr>\n"+
+"  <tr>\n"+
+"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"SharedDriveConnector.UseSIDSForSecurity")
+ "</nobr></td>\n"+
+"    <td class=\"value\"><input type=\"hidden\" name=\"resolvesidspresent\" value=\"true\"/><input
type=\"checkbox\" value=\"true\" name=\"resolvesids\" "+("true".equals(resolvesids)?"checked=\"true\"":"")+"/></td>\n"+
+"  </tr>\n"+
 "</table>\n"
       );
     }
@@ -2633,7 +2645,9 @@ public class SharedDriveConnector extend
 "<input type=\"hidden\" name=\"server\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(server)+"\"/>\n"+
 "<input type=\"hidden\" name=\"domain\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(domain)+"\"/>\n"+
 "<input type=\"hidden\" name=\"username\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(username)+"\"/>\n"+
-"<input type=\"hidden\" name=\"password\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(password)+"\"/>\n"
+"<input type=\"hidden\" name=\"password\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(password)+"\"/>\n"+
+"<input type=\"hidden\" name=\"resolvesidspresent\" value=\"true\"/>\n"+
+"<input type=\"hidden\" name=\"resolvesids\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(resolvesids)+"\"/>\n"
       );
     }
   }
@@ -2667,6 +2681,15 @@ public class SharedDriveConnector extend
     String password = variableContext.getParameter("password");
     if (password != null)
       parameters.setObfuscatedParameter(org.apache.manifoldcf.crawler.connectors.sharedrive.SharedDriveParameters.password,password);
+    
+    String resolvesidspresent = variableContext.getParameter("resolvesidspresent");
+    if (resolvesidspresent != null)
+    {
+      parameters.setParameter(SharedDriveParameters.useSIDs,"false");
+      String resolvesids = variableContext.getParameter("resolvesids");
+      if (resolvesids != null)
+        parameters.setParameter(SharedDriveParameters.useSIDs, resolvesids);
+    }
     return null;
   }
   

Modified: manifoldcf/trunk/connectors/jcifs/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharedrive/SharedDriveParameters.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/jcifs/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharedrive/SharedDriveParameters.java?rev=1384620&r1=1384619&r2=1384620&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/jcifs/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharedrive/SharedDriveParameters.java
(original)
+++ manifoldcf/trunk/connectors/jcifs/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharedrive/SharedDriveParameters.java
Fri Sep 14 01:12:52 2012
@@ -34,4 +34,8 @@ public class SharedDriveParameters
 
   /* password for the above server */
   public final static String password = "Password";
+  
+  /* SIDs handling */
+  public final static String useSIDs = "Use SIDs";
+
 }

Modified: manifoldcf/trunk/connectors/jcifs/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/sharedrive/common_en_US.properties
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/jcifs/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/sharedrive/common_en_US.properties?rev=1384620&r1=1384619&r2=1384620&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/jcifs/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/sharedrive/common_en_US.properties
(original)
+++ manifoldcf/trunk/connectors/jcifs/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/sharedrive/common_en_US.properties
Fri Sep 14 01:12:52 2012
@@ -22,6 +22,7 @@ SharedDriveConnector.URLMapping=URL Mapp
 
 SharedDriveConnector.NeedAServerName=Need a server name
 SharedDriveConnector.Server=Server
+SharedDriveConnector.UseSIDSForSecurity=Use SIDS for security:
 SharedDriveConnector.Server2=Server
 SharedDriveConnector.ServerNameCannotIncludePathInformation=Server name cannot include path
information
 SharedDriveConnector.NeedAUserName=Need a user name

Modified: manifoldcf/trunk/connectors/jcifs/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/sharedrive/common_ja_JP.properties
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/jcifs/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/sharedrive/common_ja_JP.properties?rev=1384620&r1=1384619&r2=1384620&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/jcifs/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/sharedrive/common_ja_JP.properties
(original)
+++ manifoldcf/trunk/connectors/jcifs/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/sharedrive/common_ja_JP.properties
Fri Sep 14 01:12:52 2012
@@ -20,6 +20,7 @@ SharedDriveConnector.ContentLength=�
 SharedDriveConnector.FileMapping=ファイルマッピング
 SharedDriveConnector.URLMapping=URLマッピング
 SharedDriveConnector.NeedAServerName=サーバ名を入力してください
+SharedDriveConnector.UseSIDSForSecurity=Use SIDS for security:
 SharedDriveConnector.Server=サーバ
 SharedDriveConnector.Server2=サーバ
 SharedDriveConnector.ServerNameCannotIncludePathInformation=サーバ名にパス情報を含めないでください

Propchange: manifoldcf/trunk/connectors/ldap/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Sep 14 01:12:52 2012
@@ -0,0 +1,10 @@
+build
+dist
+doc
+target
+test-output
+test-derby-output
+test-postgresql-output
+test-HSQLDB-output
+test-HSQLDBext-output
+test-mysql-output



Mime
View raw message