You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Felix Meschberger (JIRA)" <ji...@apache.org> on 2013/12/28 22:26:50 UTC

[jira] [Commented] (FELIX-4302) Config Admin can create illegal names on windows

    [ https://issues.apache.org/jira/browse/FELIX-4302?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13858117#comment-13858117 ] 

Felix Meschberger commented on FELIX-4302:
------------------------------------------

This really is nasty: If any of the PID segments starts with one of those special names storing the configuration fails.

The list of such names can be found at http://support.microsoft.com/kb/74496/en-us.

Approach to fix: After generating the File in the getFile method, all segments are checked whether they are prefixed with one of the reserved device names. This would of course only take place on windows platforms.

> Config Admin can create illegal names on windows
> ------------------------------------------------
>
>                 Key: FELIX-4302
>                 URL: https://issues.apache.org/jira/browse/FELIX-4302
>             Project: Felix
>          Issue Type: Bug
>          Components: Configuration Admin
>            Reporter: Peter Kriens
>
> The following names are not allowed to be used in a path on Windows:
> CON, PRN, AUX, CLOCK$, NUL, COM1 ... COM9, LPT1 ... LPT9.
> If the last part of the PID is one of these names then an exception results. I guess adding an extension (.cfg) to this file would prevent this clash. There might actually 
> java.io.IOException: Het systeem kan het opgegeven pad niet vinden
>     at java.io.WinNTFileSystem.createFileExclusively(Native Method)
>     at java.io.File.createNewFile(File.java:1006)
>     at java.io.File.createTempFile(File.java:1989)
>     at org.apache.felix.cm.file.FilePersistenceManager._store(FilePersistenceManager.java:621)
>     at org.apache.felix.cm.file.FilePersistenceManager.store(FilePersistenceManager.java:582)
>     at org.apache.felix.cm.impl.CachingPersistenceManagerProxy.store(CachingPersistenceManagerProxy.java:173)
>     at org.apache.felix.cm.impl.ConfigurationImpl.update(ConfigurationImpl.java:387)
>     at org.apache.felix.cm.impl.ConfigurationAdapter.update(ConfigurationAdapter.java:131)
>     at aQute.impl.configurer.Configurer.configure(Configurer.java:147)



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)