incubator-connectors-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1325742 - /incubator/lcf/branches/CONNECTORS-460/connectors/activedirectory/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/activedirectory/ActiveDirectoryAuthority.java
Date Fri, 13 Apr 2012 12:45:35 GMT
Author: kwright
Date: Fri Apr 13 12:45:35 2012
New Revision: 1325742

URL: http://svn.apache.org/viewvc?rev=1325742&view=rev
Log:
Fix password deobfuscation.

Modified:
    incubator/lcf/branches/CONNECTORS-460/connectors/activedirectory/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/activedirectory/ActiveDirectoryAuthority.java

Modified: incubator/lcf/branches/CONNECTORS-460/connectors/activedirectory/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/activedirectory/ActiveDirectoryAuthority.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-460/connectors/activedirectory/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/activedirectory/ActiveDirectoryAuthority.java?rev=1325742&r1=1325741&r2=1325742&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-460/connectors/activedirectory/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/activedirectory/ActiveDirectoryAuthority.java
(original)
+++ incubator/lcf/branches/CONNECTORS-460/connectors/activedirectory/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/activedirectory/ActiveDirectoryAuthority.java
Fri Apr 13 12:45:35 2012
@@ -135,7 +135,7 @@ public class ActiveDirectoryAuthority ex
           String dcName = cn.getAttributeValue(ActiveDirectoryConfig.ATTR_DOMAINCONTROLLER);
           // Set up the parameters for the domain controller
           dCConnectionParameters.put(dcName,new DCConnectionParameters(cn.getAttributeValue(ActiveDirectoryConfig.ATTR_USERNAME),
-            cn.getAttributeValue(ActiveDirectoryConfig.ATTR_PASSWORD),
+            deobfuscate(cn.getAttributeValue(ActiveDirectoryConfig.ATTR_PASSWORD)),
             cn.getAttributeValue(ActiveDirectoryConfig.ATTR_AUTHENTICATION),
             cn.getAttributeValue(ActiveDirectoryConfig.ATTR_USERACLsUSERNAME)));
           // Order-based rule, as well
@@ -152,6 +152,20 @@ public class ActiveDirectoryAuthority ex
       cacheLRUsize = "1000";    
   }
 
+  protected static String deobfuscate(String input)
+  {
+    if (input == null)
+      return null;
+    try
+    {
+      return ManifoldCF.deobfuscate(input);
+    }
+    catch (ManifoldCFException e)
+    {
+      return "";
+    }
+  }
+  
   // All methods below this line will ONLY be called if a connect() call succeeded
   // on this instance!
 
@@ -475,7 +489,6 @@ public class ActiveDirectoryAuthority ex
   }
   
   protected static void fillInDomainControllerTab(Map<String,Object> velocityContext,
ConfigParams parameters)
-    throws ManifoldCFException
   {
     String domainControllerName = parameters.getParameter(ActiveDirectoryConfig.PARAM_DOMAINCONTROLLER);
     String userName = parameters.getParameter(ActiveDirectoryConfig.PARAM_USERNAME);
@@ -502,9 +515,7 @@ public class ActiveDirectoryAuthority ex
           String dcSuffix = cn.getAttributeValue(ActiveDirectoryConfig.ATTR_SUFFIX);
           String dcDomainController = cn.getAttributeValue(ActiveDirectoryConfig.ATTR_DOMAINCONTROLLER);
           String dcUserName = cn.getAttributeValue(ActiveDirectoryConfig.ATTR_USERNAME);
-          String dcPassword = cn.getAttributeValue(ActiveDirectoryConfig.ATTR_PASSWORD);
-          if (dcPassword != null)
-            dcPassword = ManifoldCF.deobfuscate(dcPassword);
+          String dcPassword = deobfuscate(cn.getAttributeValue(ActiveDirectoryConfig.ATTR_PASSWORD));
           String dcAuthentication = cn.getAttributeValue(ActiveDirectoryConfig.ATTR_AUTHENTICATION);
           String dcUserACLsUsername = cn.getAttributeValue(ActiveDirectoryConfig.ATTR_USERACLsUSERNAME);
           domainControllers.add(createDomainControllerMap(dcSuffix,dcDomainController,dcUserName,dcPassword,dcAuthentication,dcUserACLsUsername));



Mime
View raw message