Skip to content

Add FFM version of Pageant AgentConnector#1001

Open
norrisjeremy wants to merge 12 commits into
mwiede:masterfrom
norrisjeremy:20260220
Open

Add FFM version of Pageant AgentConnector#1001
norrisjeremy wants to merge 12 commits into
mwiede:masterfrom
norrisjeremy:20260220

Conversation

@norrisjeremy

@norrisjeremy norrisjeremy commented Feb 20, 2026

Copy link
Copy Markdown
Contributor

This adds support for using Pageant using the JEP 454 FFM API with Java 23+ as an alternative to using JNA.

Additionally, include a few minor updates & fixes to the existing JNA based PageantConnector.

To use the new PageantFFMConnector, users will need to pass an argument of --enable-native-access=ALL-UNNAMED (if JSch is on the classpath) or --enable-native-access=com.jcraft.jsch (if JSch is on the modulepath).

Comment thread pom.xml Outdated
@norrisjeremy norrisjeremy force-pushed the 20260220 branch 16 times, most recently from a58cd12 to efa5348 Compare February 25, 2026 19:59
@norrisjeremy norrisjeremy force-pushed the 20260220 branch 2 times, most recently from 71e103a to 3b44069 Compare March 13, 2026 10:31
@sonarqubecloud

sonarqubecloud Bot commented Apr 2, 2026

Copy link
Copy Markdown

@norrisjeremy norrisjeremy force-pushed the 20260220 branch 2 times, most recently from 8562510 to 1a2a45b Compare May 27, 2026 13:19
…ProcessId() and the Java thread id.

This is needed to support virtual threads correctly, since GetCurrentThreadId() could change if the virtual thread is parked and resumed on a different carrier thread.
@norrisjeremy norrisjeremy force-pushed the 20260220 branch 2 times, most recently from 4be74a9 to edc83ea Compare June 11, 2026 19:54
…d() and the Java thread id for Java 19+.

Thread.getId() isn't final and thus could be overriden, leaving the possibility that it isn't unique.
Since virtual threads were only introduced in Java 19, using GetCurrentThreadId() should work for earlier Java releases.
This allows PageantFFMConnector to connect to an unprivileged Pageant when JSch is executed via run as Administrator.
…up fails and throws an exception, the second resource cleanup will still execute.
@sonarqubecloud

Copy link
Copy Markdown

@norrisjeremy

Copy link
Copy Markdown
Contributor Author

@mwiede I think this is ready to merge now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant