[prev in list] [next in list] [prev in thread] [next in thread]
List: openjdk-nio-dev
Subject: Re: RFR: 8324811: java/nio/file/Files/CopyMoveVariations.java fails run with non-root user
From: SendaoYan <syan () openjdk ! org>
Date: 2024-02-23 2:00:58
Message-ID: EIBE-eTtYSCrCwgG_MHfoHXJ88hQvMh1n0mogjuz4jk=.64edcd6a-7a49-48c6-9280-3a65acab3d71 () github ! com
[Download RAW message or body]
On Thu, 22 Feb 2024 21:58:51 GMT, Brian Burkhalter <bpb@openjdk.org> wrote:
> > This testcase include 3 `Files.move(source, target, options` operations(line 195, \
> > line 212, line 232), only the line 195 miss `try catch AccessDeniedException` \
> > surround.
>
> This is because `AccessDeniedException` is not expected. For a file move operation \
> there is no permission requirement unless the source is a directory, in which case \
> it must be writable.
> > And for the line 219, when there is a `AccessDeniedException`, then the source \
> > file should miss read permission, so `mode.charAt(1) != 'r'` , rather than \
> > `mode.charAt(1) != 'w'`.
>
> The modes are defined by
>
> ```
> 99 String[] modes = new String[] {
> 100 "---------", "r--r--r--", "-w--w--w-", "rw-rw-rw-"
> 101 };
> ```
>
> so I do not see how `mode.charAt(1)` could ever return `r`. Anyway, as a directory \
> and not a file is being moved, the requirement is that the source directory be \
> wrotable so `w` is correct.
> > So, it seems that it's a testcase bug cause this testcase run fail at some \
> > situation.
>
> As previously mentioned, we have not seen this in any reasonable scenario.
>
> > Maybe this PR is more reasonable than #17235
>
> Actually I think #17235 is more reasonable and that this PR should be withdrawn.
In the Linux operating system environment, the file operation permissions may be \
different if the source and target are in different partitions and if the source and \
target are in the same partition. I am not professional in this area, so this PR is \
closed.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/17606#issuecomment-1960632602
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic