summaryrefslogtreecommitdiffstats
path: root/Lib/telnetlib.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2019-06-24 16:09:47 (GMT)
committerGitHub <noreply@github.com>2019-06-24 16:09:47 (GMT)
commit8763d43a9558b345af6a3a298afa18e7d3b42fd0 (patch)
tree260bf9be22b743195365c927df1e7ad709371568 /Lib/telnetlib.py
parent366dac99c0c0c416a37874140696f59178db4e43 (diff)
downloadcpython-8763d43a9558b345af6a3a298afa18e7d3b42fd0.zip
cpython-8763d43a9558b345af6a3a298afa18e7d3b42fd0.tar.gz
cpython-8763d43a9558b345af6a3a298afa18e7d3b42fd0.tar.bz2
bpo-37363: Add audit events for a range of modules (GH-14301)
(cherry picked from commit 60419a7e96577cf783b3b45bf3984f9fb0d7ddff) Co-authored-by: Steve Dower <steve.dower@python.org>
Diffstat (limited to 'Lib/telnetlib.py')
-rw-r--r--Lib/telnetlib.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/telnetlib.py b/Lib/telnetlib.py
index b9d45b4..8ce053e 100644
--- a/Lib/telnetlib.py
+++ b/Lib/telnetlib.py
@@ -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)