[jboss-jira] [JBoss JIRA] (WFCORE-654) Configuration files get default permissions when written

Tomas Remes (JIRA) issues at jboss.org
Wed Aug 5 10:30:03 EDT 2015


    [ https://issues.jboss.org/browse/WFCORE-654?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13095797#comment-13095797 ] 

Tomas Remes commented on WFCORE-654:
------------------------------------

This fix seems to cause problems on Solaris see https://issues.jboss.org/browse/JBEAP-588.

> Configuration files get default permissions when written
> --------------------------------------------------------
>
>                 Key: WFCORE-654
>                 URL: https://issues.jboss.org/browse/WFCORE-654
>             Project: WildFly Core
>          Issue Type: Enhancement
>          Components: Domain Management
>            Reporter: James Livingston
>            Assignee: ehsavoie Hugonnet
>             Fix For: 2.0.0.Alpha11
>
>
> When ConfigurationFilePersistenceResource writes out the file, the temp file gets given the default permissions (on Unix, as per the umask) and then it is renamed over the original, resulting in losing metadata like permissions.
> As far as I know, there is no portable way to atomically replace the contents of a file without losing attributes. Setting the temp file's permissions to the same as the original is subject to race conditions, and in some circumstances is not even possible (e.g. if WF has write access but is not the file owner). On Mac OS the "exchangedata" call does what is desirable but that is not available to Java.
> NIO's PosixFileAttributeView/AclFileAttributeView would allow an attempt to be made at keeping permissions on the re-written file.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


More information about the jboss-jira mailing list