Agent
=====

The (ssh agent) module provides procedures for interacting with SSH agent instances.

 -- Scheme Procedure: ssh-agent-sock-get
     Get the SSH__AGENT__SOCK environment variable value.

 -- Scheme Procedure: ssh-agent-sock-set! sock-file
     Set the value of SSH__AGENT__SOCK environment variable to the SOCK-FILE.

 -- Scheme Procedure: ssh-agent-find-socks [keywords]
     The procedure tries to find socket file paths of all running SSH agent instances by searching the specified SEARCH-DIR and all sub-directories that meet SUBDIR-PATTERN regexp.

     search-dir
          A directory to search SSH agent socket files. Value of TMPDIR environment variable is used by default. If TMPDIR is empty, the procedure will use /tmp as the search directory name.

     subdir-pattern
          All sub-directories in search-dir that should be searched have to match this pattern. Default pattern is set to match ssh-XXXXXXXXXX names, as specified by ssh-agent man page.

     To summarize, if both search-dir and subdir-pattern are left with default values, the procedure will search for $TMPDIR/ssh-XXXXXXXXXX/agent.<ppid>

     One might use the procedure to configure the environment in a REPL to use SSH userauth-agent! procedure later:

          (define s (make-session #:host "localhost"))
          (connect! s)
          (ssh-agent-sock-set! (car (ssh-agent-find-socks)))
          (userauth-agent! s)
          (with-ssh (make-node s) (version))