Integrated: 8343020: (fs) Add support for SecureDirectoryStream on macOS
David M. Lloyd
duke at openjdk.org
Mon Oct 28 17:01:46 UTC 2024
On Thu, 24 Oct 2024 21:54:55 GMT, David M. Lloyd <duke at openjdk.org> wrote:
> 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.
>
> Additionally, we must ensure that `openat`, `fstatat`, and `fdopendir` are properly detected on MacOS x64, because there are 32- and 64-bit variations on that platform which misbehave subtly when done improperly.
This pull request has now been integrated.
Changeset: 9f6d5b46
Author: David M. Lloyd <david.lloyd at redhat.com>
Committer: Brian Burkhalter <bpb at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/9f6d5b46ce2cfcdb39f94b8ac8621ee21f4e8740
Stats: 25 lines in 3 files changed: 3 ins; 6 del; 16 mod
8343020: (fs) Add support for SecureDirectoryStream on macOS
Reviewed-by: bpb, alanb
-------------
PR: https://git.openjdk.org/jdk/pull/21696
More information about the nio-dev
mailing list