File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -36,8 +36,12 @@ pub async fn run_agent() -> Result<()> {
3636 let mut listener = AgentListener :: bind ( & socket_path)
3737 . await
3838 . with_context ( || format ! ( "Failed to bind socket {}" , socket_path. display( ) ) ) ?;
39- info ! ( "persona-ssh-agent listening at {}" , socket_path. display( ) ) ;
40- println ! ( "SSH_AUTH_SOCK={}" , socket_path. display( ) ) ;
39+ let mut endpoint = listener. address ( ) ;
40+ if endpoint == "unknown" {
41+ endpoint = socket_path. display ( ) . to_string ( ) ;
42+ }
43+ info ! ( "persona-ssh-agent listening at {}" , endpoint) ;
44+ println ! ( "SSH_AUTH_SOCK={}" , endpoint) ;
4145
4246 // Write state files
4347 let state_dir = std:: env:: var ( "PERSONA_AGENT_STATE_DIR" )
@@ -51,7 +55,7 @@ pub async fn run_agent() -> Result<()> {
5155 let _ = std:: fs:: create_dir_all ( & state_dir) ;
5256 let sock_file = state_dir. join ( "ssh-agent.sock" ) ;
5357 let pid_file = state_dir. join ( "ssh-agent.pid" ) ;
54- let _ = std:: fs:: write ( & sock_file, socket_path . display ( ) . to_string ( ) ) ;
58+ let _ = std:: fs:: write ( & sock_file, & endpoint ) ;
5559 let _ = std:: fs:: write ( & pid_file, std:: process:: id ( ) . to_string ( ) ) ;
5660
5761 // Load keys from Persona
You can’t perform that action at this time.
0 commit comments