[9] RFC on 8073061: Files.copy(foo, bar, REPLACE_EXISTING) deletes bar even if foo is not readable

Brian Burkhalter brian.burkhalter at oracle.com
Wed Feb 18 15:25:10 UTC 2015


On Feb 18, 2015, at 1:21 AM, Alan Bateman <Alan.Bateman at oracle.com> wrote:

> On 18/02/2015 09:05, Francis Galiegue wrote:
>> :
>> OK, so, in this matrix of test cases, what is supposed to happen when:
>> 
>> * the destination is a regular file on which you have write access,
>> * the source is a regular file on which you DO NOT have read access?
>> 
>> My hope: leave the destination alone. Am I right?
>> 
> That's right. The bug that we have now is that we assume that the source is readable when its attributes can be read. There is a similar issue on Windows although it's more difficult to create that scenario. And to be clear, it is not a security issue, the permission checks are correct for the case that you are running with a security manager.

Thank you for all the comments the elicitation of which was the purpose of this thread. This code is completely new to me and clearly much more complicated than it might appear at first glance. I will reexamine the situation taking these comments into account.

Brian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/nio-dev/attachments/20150218/c7ca7ce3/attachment.html>


More information about the nio-dev mailing list