Return-Path: Delivered-To: apmail-directory-dev-archive@www.apache.org Received: (qmail 47507 invoked from network); 14 Sep 2010 18:40:15 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 14 Sep 2010 18:40:15 -0000 Received: (qmail 97133 invoked by uid 500); 14 Sep 2010 18:40:15 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 97070 invoked by uid 500); 14 Sep 2010 18:40:14 -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 97063 invoked by uid 99); 14 Sep 2010 18:40:14 -0000 Received: from Unknown (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Sep 2010 18:40:14 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Sep 2010 18:39:56 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o8EIdZRb021742 for ; Tue, 14 Sep 2010 18:39:35 GMT Message-ID: <27940375.185531284489575319.JavaMail.jira@thor> Date: Tue, 14 Sep 2010 14:39:35 -0400 (EDT) From: "Stefan Seelmann (JIRA)" To: dev@directory.apache.org Subject: [jira] Created: (DIRSERVER-1551) LdifPartition file names on Unix and Windows MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org LdifPartition file names on Unix and Windows -------------------------------------------- Key: DIRSERVER-1551 URL: https://issues.apache.org/jira/browse/DIRSERVER-1551 Project: Directory ApacheDS Issue Type: Bug Affects Versions: 2.0.0-RC1 Reporter: Stefan Seelmann Fix For: 2.0.0-RC1 The LdifPartion stores entries to the file system and uses the entry's DN as file name or folder name. The DN may include (almost) every unicode character, but different file systems don't allow every character (http://en.wikipedia.org/wiki/Filenames). The current implementation escapes some characters using a backslash, howerver that doesn't work, neither on Windows nor an Unix (Linux or Mac OS X), see simple test below In DIRSERVER-1541 Richard attached a patch that uses sort of URL encoding of forbidden characters to fix the problems on Windows. I'd suggest to use the same method on Unix OSes. Index: ldif-partition/src/test/java/org/apache/directory/server/core/partition/LdifPartitionTest.java =================================================================== --- ldif-partition/src/test/java/org/apache/directory/server/core/partition/LdifPartitionTest.java (Revision 996996) +++ ldif-partition/src/test/java/org/apache/directory/server/core/partition/LdifPartitionTest.java (Arbeitskopie) @@ -567,6 +567,23 @@ } + @Test + public void testIllegalFilename() throws Exception + { + DN adminDn = new DN( "uid=admin,ou=system", schemaManager ); + CoreSession session = new MockCoreSession( new LdapPrincipal( adminDn, AuthenticationLevel.STRONG ), + new MockDirectoryService( 1 ) ); + AddOperationContext addCtx = new AddOperationContext( session ); + + ClonedServerEntry entry1 = createEntry( "dc=a/b/c,ou=test,ou=system" ); + entry1.put( "ObjectClass", "top", "domain" ); + entry1.put( "dc", "a/b/c" ); + addCtx.setEntry( entry1 ); + + partition.add( addCtx ); + } + + private CoreSession injectEntries() throws Exception { DN adminDn = new DN( "uid=admin,ou=system", schemaManager ); -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.