8073061: (fs) Files.copy(foo, bar, REPLACE_EXISTING) deletes bar even if foo is not readable

Reviewed-by: alanb
This commit is contained in:
Brian Burkhalter 2023-09-26 15:27:44 +00:00
parent efb7e85ecf
commit 36ac83904c
5 changed files with 314 additions and 14 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -495,7 +495,7 @@ public abstract class UnixFileSystemProvider
if (attrs.length > 0) {
UnixFileModeAttribute.toUnixMode(0, attrs); // may throw NPE or UOE
throw new UnsupportedOperationException("Initial file attributes" +
"not supported when creating symbolic link");
" not supported when creating symbolic link");
}
// permission check