Skip to content

Add SSH agent set/get support#355

Merged
yodaldevoid merged 1 commit into
rust-lang:masterfrom
pbar-fb:set-auth-sock
Apr 19, 2026
Merged

Add SSH agent set/get support#355
yodaldevoid merged 1 commit into
rust-lang:masterfrom
pbar-fb:set-auth-sock

Conversation

@pbar-fb

@pbar-fb pbar-fb commented Apr 17, 2026

Copy link
Copy Markdown
Contributor

libssh2 supports libssh2_agent_set_identity_path and libssh2_agent_get_identity_path, but ssh2-rs currently does not expose these - in practice this means that the SSH_AUTH_SOCK environment variable is the only way to set this in Rust.

This change exposes those in the libssh2-sys crate, and wires them up as Agent::{set_identity_path, identity_path}. Since they handle paths, also reuses the mkpath util and moves it into the util module.

@yodaldevoid

Copy link
Copy Markdown
Collaborator

Thank you for the PR!

@yodaldevoid
yodaldevoid merged commit 5219ffb into rust-lang:master Apr 19, 2026
11 checks passed
@pbar-fb
pbar-fb deleted the set-auth-sock branch April 20, 2026 16:35
meta-codesync Bot pushed a commit to facebook/sapling that referenced this pull request Apr 24, 2026
Summary:
Upgrade the ssh2 and libssh2-sys crates to a git rev of ssh2-rs that includes support for SSH agent socket get/set (rust-lang/ssh2-rs#355).

Since the release containing this PR has not yet been cut, this uses [patch.crates-io] entries to redirect all ssh2 and libssh2-sys references to the git rev. This ensures that ssh2-async (which depends on ssh2 = "0.9") resolves to the same patched version, avoiding Cargo links conflicts on the libssh2 native library. The patch entries can be removed once upstream cuts a release.

Reviewed By: dtolnay

Differential Revision: D101730713

fbshipit-source-id: d1fe2df32af938bec40b67c9e890089168cc3bbf
meta-codesync Bot pushed a commit to facebookexperimental/rust-shed that referenced this pull request Apr 24, 2026
Summary:
Upgrade the ssh2 and libssh2-sys crates to a git rev of ssh2-rs that includes support for SSH agent socket get/set (rust-lang/ssh2-rs#355).

Since the release containing this PR has not yet been cut, this uses [patch.crates-io] entries to redirect all ssh2 and libssh2-sys references to the git rev. This ensures that ssh2-async (which depends on ssh2 = "0.9") resolves to the same patched version, avoiding Cargo links conflicts on the libssh2 native library. The patch entries can be removed once upstream cuts a release.

Reviewed By: dtolnay

Differential Revision: D101730713

fbshipit-source-id: d1fe2df32af938bec40b67c9e890089168cc3bbf
meta-codesync Bot pushed a commit to facebookincubator/reindeer that referenced this pull request Apr 24, 2026
Summary:
Upgrade the ssh2 and libssh2-sys crates to a git rev of ssh2-rs that includes support for SSH agent socket get/set (rust-lang/ssh2-rs#355).

Since the release containing this PR has not yet been cut, this uses [patch.crates-io] entries to redirect all ssh2 and libssh2-sys references to the git rev. This ensures that ssh2-async (which depends on ssh2 = "0.9") resolves to the same patched version, avoiding Cargo links conflicts on the libssh2 native library. The patch entries can be removed once upstream cuts a release.

Reviewed By: dtolnay

Differential Revision: D101730713

fbshipit-source-id: d1fe2df32af938bec40b67c9e890089168cc3bbf
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.

2 participants