Return-Path: Delivered-To: apmail-directory-dev-archive@www.apache.org Received: (qmail 54948 invoked from network); 12 Aug 2005 22:11:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 12 Aug 2005 22:11:58 -0000 Received: (qmail 99214 invoked by uid 500); 12 Aug 2005 22:11:57 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 99055 invoked by uid 500); 12 Aug 2005 22:11:56 -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 99042 invoked by uid 99); 12 Aug 2005 22:11:56 -0000 X-ASF-Spam-Status: No, hits=0.0 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; Fri, 12 Aug 2005 15:11:55 -0700 Received: from ajax.apache.org (ajax.apache.org [127.0.0.1]) by ajax.apache.org (Postfix) with ESMTP id DA0B8EB for ; Sat, 13 Aug 2005 00:11:53 +0200 (CEST) Message-ID: <1317437561.1123884713870.JavaMail.jira@ajax.apache.org> Date: Sat, 13 Aug 2005 00:11:53 +0200 (CEST) From: "Emmanuel Lecharny (JIRA)" To: dev@directory.apache.org Subject: [jira] Created: (DIREVE-224) Pb with case sensitivity for attributes 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 Pb with case sensitivity for attributes --------------------------------------- Key: DIREVE-224 URL: http://issues.apache.org/jira/browse/DIREVE-224 Project: Directory Server Type: Bug Components: jdbm database Versions: 0.9.2 Reporter: Emmanuel Lecharny Priority: Blocker There is a huge problem with attributes. They are supposed to be case insensitive (RFC 2251, par. 2.5.1: "... they must be IA5 (ASCII) strings, and they are case insensitive (e.g. "foo@bar.com" will match "FOO@BAR.COM")") If we use the BasicAttribute class (javax.naming.directory.BasicAttribute) without lowercasing the attribute's name, there is no way to guarantee that we could do a attributes.get( .toLowerCase() ) with a correct response. This usage is spreaded all over the code and need to be fixed. As an example, here is a snapshot of a working code : /* * create objectClass=top, objectClass=organizationalUnit */ Attributes attributes = new BasicAttributes(); Attribute attribute = new BasicAttribute( "objectClass".toLowerCase() ); // we MUST lowercase the attribute's name attribute.add( "top" ); attribute.add( "organizationalUnit" ); attributes.put( attribute ); Attribute attr = attributes.get("objectclass".toLowerCase()); Attribute attr2 = attributes.get("objectClass".toLowerCase()); Assert.assertTrue( attr == attr2 ); // no problem, they are equal. /* * The same piece of code, without the lowerCase() */ Attributes attributes = new BasicAttributes(); Attribute attribute = new BasicAttribute( "objectClass"); attribute.add( "top" ); attribute.add( "organizationalUnit" ); attributes.put( attribute ); Attribute attr = attributes.get("objectclass"); Attribute attr2 = attributes.get("objectClass"); Assert.assertTrue( attr == attr2 ); // they are different, as attr is null. -- 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