From e8bb810e49f1e41ac21071c6d4da19066362ca88 Mon Sep 17 00:00:00 2001
From: ludovicp <ludovicp@localhost>
Date: Mon, 31 May 2010 12:22:12 +0000
Subject: [PATCH] Do preliminary acceptance checked for password policy subentries within the PwP import plugin.
---
opends/src/server/org/opends/server/plugins/PasswordPolicyImportPlugin.java | 24 +++++++++++++++++++++++-
1 files changed, 23 insertions(+), 1 deletions(-)
diff --git a/opends/src/server/org/opends/server/plugins/PasswordPolicyImportPlugin.java b/opends/src/server/org/opends/server/plugins/PasswordPolicyImportPlugin.java
index b258a0b..5ed8f7e 100644
--- a/opends/src/server/org/opends/server/plugins/PasswordPolicyImportPlugin.java
+++ b/opends/src/server/org/opends/server/plugins/PasswordPolicyImportPlugin.java
@@ -22,7 +22,7 @@
* CDDL HEADER END
*
*
- * Copyright 2006-2008 Sun Microsystems, Inc.
+ * Copyright 2006-2010 Sun Microsystems, Inc.
*/
package org.opends.server.plugins;
@@ -57,6 +57,7 @@
import org.opends.server.config.ConfigException;
import org.opends.server.core.DirectoryServer;
import org.opends.server.core.PasswordPolicy;
+import org.opends.server.core.PasswordPolicyConfigManager;
import org.opends.server.loggers.debug.DebugTracer;
import org.opends.server.schema.AuthPasswordSyntax;
import org.opends.server.schema.UserPasswordSyntax;
@@ -325,6 +326,27 @@
public final PluginResult.ImportLDIF
doLDIFImport(LDIFImportConfig importConfig, Entry entry)
{
+ // Check if this entry is a password policy subentry
+ // and if so evaluate whether or not its acceptable.
+ if ((entry.isSubentry() || entry.isLDAPSubentry()) &&
+ entry.isPasswordPolicySubentry())
+ {
+ try
+ {
+ PasswordPolicyConfigManager.checkSubentryAcceptable(entry);
+ }
+ catch (DirectoryException de)
+ {
+ if (debugEnabled())
+ {
+ TRACER.debugCaught(DebugLogLevel.ERROR, de);
+ }
+
+ return PluginResult.ImportLDIF.stopEntryProcessing(
+ de.getMessageObject());
+ }
+ }
+
// See if the entry explicitly states the password policy that it should
// use. If so, then only use it to perform the encoding.
List<Attribute> attrList = entry.getAttribute(customPolicyAttribute);
--
Gitblit v1.10.0