You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ka...@apache.org on 2014/02/14 21:54:58 UTC

svn commit: r1568515 - /directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/PasswordHashingInterceptor.java

Author: kayyagari
Date: Fri Feb 14 20:54:57 2014
New Revision: 1568515

URL: http://svn.apache.org/r1568515
Log:
check for password attribute in all modifications

Modified:
    directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/PasswordHashingInterceptor.java

Modified: directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/PasswordHashingInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/PasswordHashingInterceptor.java?rev=1568515&r1=1568514&r2=1568515&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/PasswordHashingInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/PasswordHashingInterceptor.java Fri Feb 14 20:54:57 2014
@@ -30,6 +30,7 @@ import org.apache.directory.api.ldap.mod
 import org.apache.directory.api.ldap.model.entry.DefaultAttribute;
 import org.apache.directory.api.ldap.model.entry.Entry;
 import org.apache.directory.api.ldap.model.entry.Modification;
+import org.apache.directory.api.ldap.model.entry.ModificationOperation;
 import org.apache.directory.api.ldap.model.entry.Value;
 import org.apache.directory.api.ldap.model.exception.LdapException;
 import org.apache.directory.api.ldap.model.password.PasswordUtil;
@@ -113,14 +114,17 @@ public abstract class PasswordHashingInt
             // check for modification on 'userPassword' AT
             if ( SchemaConstants.USER_PASSWORD_AT_OID.equals( oid ) )
             {
+                if ( mod.getOperation() == ModificationOperation.REMOVE_ATTRIBUTE )
+                {
+                   continue; 
+                }
+                
                 Attribute newPwd = includeHashedPassword( mod.getAttribute() );
 
                 if ( newPwd != null )
                 {
                     mod.setAttribute( newPwd );
                 }
-
-                break;
             }
         }