You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by "Brian Gadwell (JIRA)" <ji...@apache.org> on 2007/05/03 20:19:15 UTC

[jira] Created: (DIRSERVER-917) ldif path on windows platform that has possible hex values after file seperator causes NaminException upon server startup

ldif path on windows platform that has possible hex values after file seperator causes NaminException upon server startup
-------------------------------------------------------------------------------------------------------------------------

                 Key: DIRSERVER-917
                 URL: https://issues.apache.org/jira/browse/DIRSERVER-917
             Project: Directory ApacheDS
          Issue Type: Bug
    Affects Versions: 1.5.0
         Environment: Windows
            Reporter: Brian Gadwell


This issue occurs when a path to the ldif directory set via
    MutableServerStartupConfiguration.setLdifDirectory(File)
gets resolved on a windows machine. Whatever is enter for the path file seperator in the File argument ('/' or '\') gets resolved to \ on windows which is then considered an escape for a hex sequence. If the next 2 bytes following the file seperator are possible hex values they are interpreted as such leading to an invalid path.
For example if you used new File("../ldif) and it got resolved to C:\dev\ldif you would see something like the following stack trace.

This is a blocking issue in my case, but I entered it as a major priority. 

javax.naming.NamingException: Invalid value : C:?v\ldif\myldif.ldif
    at org.apache.directory.shared.ldap.schema.DeepTrimToLowerNormalizer.normalize (DeepTrimToLowerNormalizer.java:65)
    at org.apache.directory.shared.ldap.schema.CachingNormalizer.normalize(CachingNormalizer.java:95)
    at org.apache.directory.shared.ldap.name.LdapDN.rdnOidToName(LdapDN.java:1402)
    at org.apache.directory.shared.ldap.name.LdapDN.normalize(LdapDN.java:1459)
    at org.apache.directory.server.core.normalization.NormalizationService.add(NormalizationService.java:116)
    at org.apache.directory.server.core.interceptor.InterceptorChain.add (InterceptorChain.java:708)
    at org.apache.directory.server.core.partition.PartitionNexusProxy.add(PartitionNexusProxy.java:341)
    at org.apache.directory.server.core.partition.PartitionNexusProxy.add(PartitionNexusProxy.java :329)
    at org.apache.directory.server.core.jndi.ServerDirContext.createSubcontext(ServerDirContext.java:428)
    at org.apache.directory.server.core.jndi.ServerDirContext.createSubcontext(ServerDirContext.java:374)
    at org.apache.directory.server.jndi.ServerContextFactory.addFileEntry(ServerContextFactory.java:258)
    at org.apache.directory.server.jndi.ServerContextFactory.loadLdifs(ServerContextFactory.java:383)
    at org.apache.directory.server.jndi.ServerContextFactory.afterStartup(ServerContextFactory.java:209)
    at org.apache.directory.server.core.DefaultDirectoryService.startup(DefaultDirectoryService.java:268)
    at org.apache.directory.server.core.jndi.AbstractContextFactory.getInitialContext (AbstractContextFactory.java:123)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (DIRSERVER-917) ldif path on windows platform that has possible hex values after file seperator causes NaminException upon server startup

Posted by "Emmanuel Lecharny (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DIRSERVER-917?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Emmanuel Lecharny closed DIRSERVER-917.
---------------------------------------


closed

> ldif path on windows platform that has possible hex values after file seperator causes NaminException upon server startup
> -------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DIRSERVER-917
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-917
>             Project: Directory ApacheDS
>          Issue Type: Bug
>    Affects Versions: 1.5.0
>         Environment: Windows
>            Reporter: Brian Gadwell
>            Assignee: Emmanuel Lecharny
>
> This issue occurs when a path to the ldif directory set via
>     MutableServerStartupConfiguration.setLdifDirectory(File)
> gets resolved on a windows machine. Whatever is enter for the path file seperator in the File argument ('/' or '\') gets resolved to \ on windows which is then considered an escape for a hex sequence. If the next 2 bytes following the file seperator are possible hex values they are interpreted as such leading to an invalid path.
> For example if you used new File("../ldif) and it got resolved to C:\dev\ldif you would see something like the following stack trace.
> This is a blocking issue in my case, but I entered it as a major priority. 
> javax.naming.NamingException: Invalid value : C:?v\ldif\myldif.ldif
>     at org.apache.directory.shared.ldap.schema.DeepTrimToLowerNormalizer.normalize (DeepTrimToLowerNormalizer.java:65)
>     at org.apache.directory.shared.ldap.schema.CachingNormalizer.normalize(CachingNormalizer.java:95)
>     at org.apache.directory.shared.ldap.name.LdapDN.rdnOidToName(LdapDN.java:1402)
>     at org.apache.directory.shared.ldap.name.LdapDN.normalize(LdapDN.java:1459)
>     at org.apache.directory.server.core.normalization.NormalizationService.add(NormalizationService.java:116)
>     at org.apache.directory.server.core.interceptor.InterceptorChain.add (InterceptorChain.java:708)
>     at org.apache.directory.server.core.partition.PartitionNexusProxy.add(PartitionNexusProxy.java:341)
>     at org.apache.directory.server.core.partition.PartitionNexusProxy.add(PartitionNexusProxy.java :329)
>     at org.apache.directory.server.core.jndi.ServerDirContext.createSubcontext(ServerDirContext.java:428)
>     at org.apache.directory.server.core.jndi.ServerDirContext.createSubcontext(ServerDirContext.java:374)
>     at org.apache.directory.server.jndi.ServerContextFactory.addFileEntry(ServerContextFactory.java:258)
>     at org.apache.directory.server.jndi.ServerContextFactory.loadLdifs(ServerContextFactory.java:383)
>     at org.apache.directory.server.jndi.ServerContextFactory.afterStartup(ServerContextFactory.java:209)
>     at org.apache.directory.server.core.DefaultDirectoryService.startup(DefaultDirectoryService.java:268)
>     at org.apache.directory.server.core.jndi.AbstractContextFactory.getInitialContext (AbstractContextFactory.java:123)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (DIRSERVER-917) ldif path on windows platform that has possible hex values after file seperator causes NaminException upon server startup

Posted by "Emmanuel Lecharny (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DIRSERVER-917?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Emmanuel Lecharny resolved DIRSERVER-917.
-----------------------------------------

    Resolution: Fixed

I have fixed this issue by translating the file name to it's hexadecimal textual representation :

0 -> 30,
A -> 41
a -> 61
etc...

so that we only store a String with only [0-9A-Z]* chars.

It should work for any kind of file names, on windows and linux. 

> ldif path on windows platform that has possible hex values after file seperator causes NaminException upon server startup
> -------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DIRSERVER-917
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-917
>             Project: Directory ApacheDS
>          Issue Type: Bug
>    Affects Versions: 1.5.0
>         Environment: Windows
>            Reporter: Brian Gadwell
>         Assigned To: Emmanuel Lecharny
>
> This issue occurs when a path to the ldif directory set via
>     MutableServerStartupConfiguration.setLdifDirectory(File)
> gets resolved on a windows machine. Whatever is enter for the path file seperator in the File argument ('/' or '\') gets resolved to \ on windows which is then considered an escape for a hex sequence. If the next 2 bytes following the file seperator are possible hex values they are interpreted as such leading to an invalid path.
> For example if you used new File("../ldif) and it got resolved to C:\dev\ldif you would see something like the following stack trace.
> This is a blocking issue in my case, but I entered it as a major priority. 
> javax.naming.NamingException: Invalid value : C:?v\ldif\myldif.ldif
>     at org.apache.directory.shared.ldap.schema.DeepTrimToLowerNormalizer.normalize (DeepTrimToLowerNormalizer.java:65)
>     at org.apache.directory.shared.ldap.schema.CachingNormalizer.normalize(CachingNormalizer.java:95)
>     at org.apache.directory.shared.ldap.name.LdapDN.rdnOidToName(LdapDN.java:1402)
>     at org.apache.directory.shared.ldap.name.LdapDN.normalize(LdapDN.java:1459)
>     at org.apache.directory.server.core.normalization.NormalizationService.add(NormalizationService.java:116)
>     at org.apache.directory.server.core.interceptor.InterceptorChain.add (InterceptorChain.java:708)
>     at org.apache.directory.server.core.partition.PartitionNexusProxy.add(PartitionNexusProxy.java:341)
>     at org.apache.directory.server.core.partition.PartitionNexusProxy.add(PartitionNexusProxy.java :329)
>     at org.apache.directory.server.core.jndi.ServerDirContext.createSubcontext(ServerDirContext.java:428)
>     at org.apache.directory.server.core.jndi.ServerDirContext.createSubcontext(ServerDirContext.java:374)
>     at org.apache.directory.server.jndi.ServerContextFactory.addFileEntry(ServerContextFactory.java:258)
>     at org.apache.directory.server.jndi.ServerContextFactory.loadLdifs(ServerContextFactory.java:383)
>     at org.apache.directory.server.jndi.ServerContextFactory.afterStartup(ServerContextFactory.java:209)
>     at org.apache.directory.server.core.DefaultDirectoryService.startup(DefaultDirectoryService.java:268)
>     at org.apache.directory.server.core.jndi.AbstractContextFactory.getInitialContext (AbstractContextFactory.java:123)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRSERVER-917) ldif path on windows platform that has possible hex values after file seperator causes NaminException upon server startup

Posted by "Emmanuel Lecharny (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRSERVER-917?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12493880 ] 

Emmanuel Lecharny commented on DIRSERVER-917:
---------------------------------------------

Fix :
http://svn.apache.org/viewvc?view=rev&rev=535525

> ldif path on windows platform that has possible hex values after file seperator causes NaminException upon server startup
> -------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DIRSERVER-917
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-917
>             Project: Directory ApacheDS
>          Issue Type: Bug
>    Affects Versions: 1.5.0
>         Environment: Windows
>            Reporter: Brian Gadwell
>         Assigned To: Emmanuel Lecharny
>
> This issue occurs when a path to the ldif directory set via
>     MutableServerStartupConfiguration.setLdifDirectory(File)
> gets resolved on a windows machine. Whatever is enter for the path file seperator in the File argument ('/' or '\') gets resolved to \ on windows which is then considered an escape for a hex sequence. If the next 2 bytes following the file seperator are possible hex values they are interpreted as such leading to an invalid path.
> For example if you used new File("../ldif) and it got resolved to C:\dev\ldif you would see something like the following stack trace.
> This is a blocking issue in my case, but I entered it as a major priority. 
> javax.naming.NamingException: Invalid value : C:?v\ldif\myldif.ldif
>     at org.apache.directory.shared.ldap.schema.DeepTrimToLowerNormalizer.normalize (DeepTrimToLowerNormalizer.java:65)
>     at org.apache.directory.shared.ldap.schema.CachingNormalizer.normalize(CachingNormalizer.java:95)
>     at org.apache.directory.shared.ldap.name.LdapDN.rdnOidToName(LdapDN.java:1402)
>     at org.apache.directory.shared.ldap.name.LdapDN.normalize(LdapDN.java:1459)
>     at org.apache.directory.server.core.normalization.NormalizationService.add(NormalizationService.java:116)
>     at org.apache.directory.server.core.interceptor.InterceptorChain.add (InterceptorChain.java:708)
>     at org.apache.directory.server.core.partition.PartitionNexusProxy.add(PartitionNexusProxy.java:341)
>     at org.apache.directory.server.core.partition.PartitionNexusProxy.add(PartitionNexusProxy.java :329)
>     at org.apache.directory.server.core.jndi.ServerDirContext.createSubcontext(ServerDirContext.java:428)
>     at org.apache.directory.server.core.jndi.ServerDirContext.createSubcontext(ServerDirContext.java:374)
>     at org.apache.directory.server.jndi.ServerContextFactory.addFileEntry(ServerContextFactory.java:258)
>     at org.apache.directory.server.jndi.ServerContextFactory.loadLdifs(ServerContextFactory.java:383)
>     at org.apache.directory.server.jndi.ServerContextFactory.afterStartup(ServerContextFactory.java:209)
>     at org.apache.directory.server.core.DefaultDirectoryService.startup(DefaultDirectoryService.java:268)
>     at org.apache.directory.server.core.jndi.AbstractContextFactory.getInitialContext (AbstractContextFactory.java:123)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (DIRSERVER-917) ldif path on windows platform that has possible hex values after file seperator causes NaminException upon server startup

Posted by "Emmanuel Lecharny (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DIRSERVER-917?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Emmanuel Lecharny reassigned DIRSERVER-917:
-------------------------------------------

    Assignee: Emmanuel Lecharny

> ldif path on windows platform that has possible hex values after file seperator causes NaminException upon server startup
> -------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DIRSERVER-917
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-917
>             Project: Directory ApacheDS
>          Issue Type: Bug
>    Affects Versions: 1.5.0
>         Environment: Windows
>            Reporter: Brian Gadwell
>         Assigned To: Emmanuel Lecharny
>
> This issue occurs when a path to the ldif directory set via
>     MutableServerStartupConfiguration.setLdifDirectory(File)
> gets resolved on a windows machine. Whatever is enter for the path file seperator in the File argument ('/' or '\') gets resolved to \ on windows which is then considered an escape for a hex sequence. If the next 2 bytes following the file seperator are possible hex values they are interpreted as such leading to an invalid path.
> For example if you used new File("../ldif) and it got resolved to C:\dev\ldif you would see something like the following stack trace.
> This is a blocking issue in my case, but I entered it as a major priority. 
> javax.naming.NamingException: Invalid value : C:?v\ldif\myldif.ldif
>     at org.apache.directory.shared.ldap.schema.DeepTrimToLowerNormalizer.normalize (DeepTrimToLowerNormalizer.java:65)
>     at org.apache.directory.shared.ldap.schema.CachingNormalizer.normalize(CachingNormalizer.java:95)
>     at org.apache.directory.shared.ldap.name.LdapDN.rdnOidToName(LdapDN.java:1402)
>     at org.apache.directory.shared.ldap.name.LdapDN.normalize(LdapDN.java:1459)
>     at org.apache.directory.server.core.normalization.NormalizationService.add(NormalizationService.java:116)
>     at org.apache.directory.server.core.interceptor.InterceptorChain.add (InterceptorChain.java:708)
>     at org.apache.directory.server.core.partition.PartitionNexusProxy.add(PartitionNexusProxy.java:341)
>     at org.apache.directory.server.core.partition.PartitionNexusProxy.add(PartitionNexusProxy.java :329)
>     at org.apache.directory.server.core.jndi.ServerDirContext.createSubcontext(ServerDirContext.java:428)
>     at org.apache.directory.server.core.jndi.ServerDirContext.createSubcontext(ServerDirContext.java:374)
>     at org.apache.directory.server.jndi.ServerContextFactory.addFileEntry(ServerContextFactory.java:258)
>     at org.apache.directory.server.jndi.ServerContextFactory.loadLdifs(ServerContextFactory.java:383)
>     at org.apache.directory.server.jndi.ServerContextFactory.afterStartup(ServerContextFactory.java:209)
>     at org.apache.directory.server.core.DefaultDirectoryService.startup(DefaultDirectoryService.java:268)
>     at org.apache.directory.server.core.jndi.AbstractContextFactory.getInitialContext (AbstractContextFactory.java:123)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.