RFR: 8324635: (zipfs) Regression in Files.setPosixFilePermissions called on existing MSDOS entries [v2]
Eirik Bjørsnøs
eirbjo at openjdk.org
Fri Feb 2 21:20:29 UTC 2024
> Please review this PR to fix to a regression in ZipFileSystem, introduced by JDK-8322565 in PR #17170.
>
> When `Files.setPosixFilePermissions` is called on an existing MSDOS entry, then `Entry.posixPerms` field will be -1 (all 1s in binary). The logic introduced by JDK-8322565 did not account for this and incorrectly sets the leading seven bits to all ones instead of all zeros.
>
> The fix is to introduce a branch for `Entry.posixPerms` being -1 and deal with that case separately.
>
> The PR adds a test case to `TestPosix` which reproduces the regression. While visiting this test, I also fixed an incorrect spelling of `setPosixFilePermissions` (also introduced by #17170).
Eirik Bjørsnøs has updated the pull request incrementally with one additional commit since the last revision:
For clarity, add comments with the before/after zipdetails output of the relevant CEN fields
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/17556/files
- new: https://git.openjdk.org/jdk/pull/17556/files/dabe0fb7..4bb77e1e
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=17556&range=01
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=17556&range=00-01
Stats: 22 lines in 1 file changed: 20 ins; 0 del; 2 mod
Patch: https://git.openjdk.org/jdk/pull/17556.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/17556/head:pull/17556
PR: https://git.openjdk.org/jdk/pull/17556
More information about the core-libs-dev
mailing list