From e99cb0b579d72ece94178ca72e1bd6ac551b99ff Mon Sep 17 00:00:00 2001 From: Joe Testa Date: Tue, 20 Jun 2023 08:43:11 -0400 Subject: [PATCH] Now prints the reason why socket listening operations fail. --- src/ssh_audit/ssh_socket.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ssh_audit/ssh_socket.py b/src/ssh_audit/ssh_socket.py index 5afa4ce..9e6ca38 100644 --- a/src/ssh_audit/ssh_socket.py +++ b/src/ssh_audit/ssh_socket.py @@ -105,8 +105,8 @@ class SSH_Socket(ReadBuf, WriteBuf): s.bind(('0.0.0.0', self.__port)) s.listen() self.__sock_map[s.fileno()] = s - except Exception: - print("Warning: failed to listen on any IPv4 interfaces.") + except Exception as e: + print("Warning: failed to listen on any IPv4 interfaces: %s" % str(e)) try: # Socket to listen on all IPv6 addresses. @@ -116,8 +116,8 @@ class SSH_Socket(ReadBuf, WriteBuf): s.bind(('::', self.__port)) s.listen() self.__sock_map[s.fileno()] = s - except Exception: - print("Warning: failed to listen on any IPv6 interfaces.") + except Exception as e: + print("Warning: failed to listen on any IPv6 interfaces: %s" % str(e)) # If we failed to listen on any interfaces, terminate. if len(self.__sock_map.keys()) == 0: