rust-lang / rust-lang/ssh2-rs

inspecting SSH agent deadlocks on windows

Open
#309 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
566
Forks
163
Avg merge
4h 51m
Merged PRs (30d)
2

Description

While following the Inspecting SSH Agent example, I experience a deadlock while trying to list the identities. Snippet of my code provided below.

I have ensured that ssh-agent is running and that keys are available as evident by running ssh-add -l. I am on Windows 10, using Mingw64 (Msys2). Rust version is 1.72.1

use ssh2::Session;

fn main() {
    let sess = Session::new().unwrap();
    let mut agent = sess.agent().unwrap();
    println!("agent created");

    agent.connect().unwrap();
    println!("agent connected");

    agent.list_identities().unwrap();
    println!("identities loaded");

    let values = agent.identities().unwrap();
    for v in values {
        dbg!(&v);
    }
}

Output:

$ eval `ssh-agent`
Agent pid blah

$ ssh-add
Identity added: blah

$ cargo run
agent created
agent connected

After the "agent connected" output is where the exe deadlocks.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the inspecting SSH Agent example and the identities path in src/agent.rs around the linked line. Reproduce the Windows 10/Mingw64 case and determine where the call after agent.connect() stops progressing. Done means the example lists available identities without deadlocking on Windows.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.