From dev-return-9144-apmail-directory-dev-archive=directory.apache.org@directory.apache.org Sat Nov 12 17:42:05 2005 Return-Path: Delivered-To: apmail-directory-dev-archive@www.apache.org Received: (qmail 49073 invoked from network); 12 Nov 2005 17:41:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 12 Nov 2005 17:41:57 -0000 Received: (qmail 25429 invoked by uid 500); 12 Nov 2005 17:41:43 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 25374 invoked by uid 500); 12 Nov 2005 17:41:43 -0000 Mailing-List: contact dev-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Apache Directory Developers List" Delivered-To: mailing list dev@directory.apache.org Received: (qmail 25363 invoked by uid 99); 12 Nov 2005 17:41:43 -0000 X-ASF-Spam-Status: No, hits=1.3 required=10.0 tests=SPF_FAIL X-Spam-Check-By: apache.org Received: from [192.87.106.226] (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 12 Nov 2005 09:41:43 -0800 Received: from ajax.apache.org (ajax.apache.org [127.0.0.1]) by ajax.apache.org (Postfix) with ESMTP id 0FB1BDE for ; Sat, 12 Nov 2005 18:41:22 +0100 (CET) Message-ID: <1125098680.1131817282061.JavaMail.jira@ajax.apache.org> Date: Sat, 12 Nov 2005 18:41:22 +0100 (CET) From: "Alex Karasulu (JIRA)" To: dev@directory.apache.org Subject: [jira] Resolved: (DIREVE-306) SchemaService modifies attibute while checking for removal of last attribute value In-Reply-To: <930491634.1131697084208.JavaMail.jira@ajax.apache.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/DIREVE-306?page=all ] Alex Karasulu resolved DIREVE-306: ---------------------------------- Fix Version: 0.9.4 Resolution: Fixed Committed small recommended change in revision 332797 > SchemaService modifies attibute while checking for removal of last attribute value > ---------------------------------------------------------------------------------- > > Key: DIREVE-306 > URL: http://issues.apache.org/jira/browse/DIREVE-306 > Project: Directory Server > Type: Bug > Components: interceptors > Versions: 0.9.3 > Reporter: Claus Turkalj > Assignee: Alex Karasulu > Fix For: 0.9.4 > > The SchemaService is modifying an attribute although it is not the last interceptor in the interceptor chain. If one of the interceptors invoked after the SchemaService throws an exception, the modification has already been commited. > The modification happens while the SchemaService checks if a DirContext.REMOVE_ATTRIBUTE operation removes the last value of an attribute: > private boolean isCompleteRemoval( Attribute change, Attributes entry ) throws NamingException > { > // if change size is 0 then all values are deleted then we're screwed > if ( change.size() == 0 ) > { > return true; > } > // can't do math to figure our if all values are removed since some > // values in the modify request may not be in the entry. we need to > // remove the values from a cloned version of the attribute and see > // if nothing is left. > Attribute changedEntryAttr = entry.get( change.getID() ); > for ( int jj = 0; jj < change.size(); jj++ ) > { > changedEntryAttr.remove( change.get( jj ) ); > } > return changedEntryAttr.size() == 0; > } > Changing the line > Attribute changedEntryAttr = entry.get( change.getID() ); > to > Attribute changedEntryAttr = entry.get( change.getID() ).clone(); > seems to fix the problem. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira