[ 
https://issues.apache.org/jira/browse/DIRSERVER-1551?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Stefan Seelmann resolved DIRSERVER-1551.
----------------------------------------

      Assignee: Stefan Seelmann
    Resolution: Fixed

Fixed here:
  http://svn.apache.org/viewvc?rev=998606&view=rev


> 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
>            Assignee: 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.

Reply via email to