Fix SSH forwarding for exec process by Reneechang17 · Pull Request #506 · apple/container

This PR fixes SSH forwarding for exec processes.

Currently, only init processes received the SSH_AUTH_SOCK environment variable when using --ssh flag. Exec processes didn't have access to the SSH agent socket, even though the socket was mounted.

Now we set environment variable for exec processes to match init process behavior, ensuring SSH forwarding works consistently across processes, and refactoring SSH forwarding condition into hostSocketUrl() helper function.