RFR: 8343020: SecureDirectoryStream not supported on MacOS [v2]
David M. Lloyd
duke at openjdk.org
Fri Oct 25 16:10:20 UTC 2024
> OpenJDK will not produce SecureDirectoryStreams on MacOS. Support for SecureDirectoryStream on UNIX-like OSes is predicated on the `SUPPORTS_OPENAT` flag in UnixNativeDispatcher. That flag in turn is set when the runtime environment supports `openat`, `fstatat`, `unlinkat`, `renameat`, `futimesat`, and `fdopendir`.
>
> This fails on MacOS because `futimesat` does not exist on that platform, apparently having been a proposed-but-not-accepted part of POSIX some time ago. While there is an indirect replacement that is supported on MacOS - `utimensat` - this is not actually needed, because the unique functionality provided by `futimesat` (that is, performing the action of `futimes` relative to an open directory file descriptor) is not utilized, since the only place this function is used passes `NULL` as the relative filename argument.
>
> Replacing this with simply calling `futimes` instead allows `SecureDirectoryStream` to function on MacOS.
David M. Lloyd has updated the pull request incrementally with one additional commit since the last revision:
Use 64-bit variation when 64-bit inodes are detected on macos x86
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/21696/files
- new: https://git.openjdk.org/jdk/pull/21696/files/8bb31fdc..4572704b
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=21696&range=01
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=21696&range=00-01
Stats: 4 lines in 1 file changed: 2 ins; 0 del; 2 mod
Patch: https://git.openjdk.org/jdk/pull/21696.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/21696/head:pull/21696
PR: https://git.openjdk.org/jdk/pull/21696
More information about the nio-dev
mailing list