bpo-37363: Add audit events for a range of modules (GH-14301)

This commit is contained in:
Steve Dower 2019-06-24 08:42:54 -07:00 committed by GitHub
parent 9bbf4d7083
commit 60419a7e96
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
37 changed files with 165 additions and 18 deletions

View file

@ -231,6 +231,7 @@ class Telnet:
self.host = host
self.port = port
self.timeout = timeout
sys.audit("telnetlib.Telnet.open", self, host, port)
self.sock = socket.create_connection((host, port), timeout)
def __del__(self):
@ -286,6 +287,7 @@ class Telnet:
"""
if IAC in buffer:
buffer = buffer.replace(IAC, IAC+IAC)
sys.audit("telnetlib.Telnet.write", self, buffer)
self.msg("send %r", buffer)
self.sock.sendall(buffer)