RFR: 8356493: (fs) SecureDirectoryStream missing some capabilities [v2]

Brian Burkhalter bpb at openjdk.org
Thu Sep 4 20:44:42 UTC 2025


On Thu, 4 Sep 2025 16:56:56 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

>>> > Maybe the usability of simple cases would be improved by a `createLink(T link, T target)` overload (that passed `olddirfd=AT_FDCWD` to the underlying syscall)?
>>> 
>>> That's a thought. Or maybe have it be the same directory as the link?
>> 
>> That seems unnecessarily restrictive, since `secureStream.createLink(link, secureStream, target)` easily accomplishes that with full-featured overload.
>> 
>>> 
>>> > I think this may also need a `LinkOption` flag to pass `AT_FOLLOW_SYMLINKS`?
>>> 
>>> This method was intended to mirror `File.createLink` which does not have this option.
>> 
>> Probably because `link(2)` always follows symlinks?
>
>> > This method was intended to mirror `File.createLink` which does not have this option.
>> 
>> Probably because `link(2)` always follows symlinks?
> 
> Good point. I should revise this. Thanks.

> Maybe the usability of simple cases would be improved by a `createLink(T link, T target)` overload (that passed `olddirfd=AT_FDCWD` to the underlying syscall)?

This could also be accomplished by passing as `targetdir` a `SecureDirectoryStream` created for the `Path` of `System.getProperty("user.dir")`.

I suppose it depends on how common the case is as to whether a convenience method is worthwhile.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26950#discussion_r2323506922


More information about the nio-dev mailing list