agent: close socket server after exception

nistp521
Roman Zeyde 9 years ago
parent 6a110a9d4c
commit 7c25eaad7f

@ -81,7 +81,9 @@ def serve(key_files, command, signer, sock_path=None):
environ = {'SSH_AUTH_SOCK': sock_path, 'SSH_AGENT_PID': str(os.getpid())}
with unix_domain_socket_server(sock_path) as server:
with spawn(worker_thread, server=server, keys=keys, signer=signer):
try:
ret = run(command=command, environ=environ)
finally:
log.debug('closing server')
server.shutdown(socket.SHUT_RD)

Loading…
Cancel
Save