RFR: 8277489: Rewrite JAAS UnixLoginModule with FFM
Weijun Wang
weijun at openjdk.org
Mon Dec 22 14:06:17 UTC 2025
On Mon, 22 Dec 2025 07:19:11 GMT, Shawn M Emery <duke at openjdk.org> wrote:
>> Rewrite the native calls with FFM.
>
> src/jdk.security.auth/share/classes/com/sun/security/auth/module/UnixSystem.java line 67:
>
>> 65: }
>> 66:
>> 67: var gs = scope.allocate(gid_t, groupnum);
>
> Should this be the size of gid_t * groupnum as the first argument and the byte alignment as the second?
This is `MemorySegment allocate(MemoryLayout elementLayout, long count)` in `SegmentAllocator.java`.
> src/jdk.security.auth/share/classes/com/sun/security/auth/module/UnixSystem.java line 70:
>
>> 68: groupnum = getgroups(groupnum, gs);
>> 69: if (groupnum == -1) {
>> 70: throw new RuntimeException("getgroups returns " + groupnum);
>
> Not a must-have, but would be nice to have a FFM for `errno` to provide better diagnostics.
Yes.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28931#discussion_r2639978799
PR Review Comment: https://git.openjdk.org/jdk/pull/28931#discussion_r2639979845
More information about the build-dev
mailing list