Eric Lessard created FELIX-5711:
-----------------------------------

             Summary: FileInstall drops escape characters when writing 
configuration file back to disk
                 Key: FELIX-5711
                 URL: https://issues.apache.org/jira/browse/FELIX-5711
             Project: Felix
          Issue Type: Bug
          Components: File Install
    Affects Versions: fileinstall-3.6.0
            Reporter: Eric Lessard


FileInstall allows substitution characters to be escaped so they are kept as-is 
when read from a configuration file and in memory. So, for the following 
configuration file property:
{noformat}
property = $\{value\}
{noformat}

The following key/value pair will be present in memory:
{noformat}
property, ${value}
{noformat}

This works well unless FileInstall is configured to write the configurations 
back to disk ({{felix.fileinstall.enableConfigSave=true}}). In that case, the 
value is written back to the file as-is, i.e., without the {{\}} escape 
characters:
{noformat}
property = ${value}
{noformat}

At that point, if the file needs to be read back in (e.g., content or time 
stamp of the file changes), substitution will occurs since the substitution 
characters were not escaped when the value was written back out to the file.

Since the only way for the substitution characters to be present in memory 
inside a value is if they have been previously escaped when the file was read 
in, then they should also be escaped when written back out so they remain 
unchanged if they ever need to be read in again.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to