RFR: 8357425: (fs) SecureDirectoryStream setPermissions should use fchmodat

Alan Bateman alanb at openjdk.org
Fri May 30 05:40:50 UTC 2025


On Thu, 29 May 2025 23:37:26 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

> Modify to use the `fchmodat(2)` system call to set permissions where possible to do so. This fixes the problem presented in the issue description.

src/java.base/unix/native/libnio/fs/UnixNativeDispatcher.c line 817:

> 815:     const char* path = (const char*)jlong_to_ptr(pathAddress);
> 816: 
> 817:     RESTARTABLE(fchmodat((int)fd, path, (mode_t)mode, (int)flag), err);

@MBaesken Do you want to confirm that this will build/run on AIX?

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/25534#discussion_r2115175107


More information about the nio-dev mailing list