diff options
author | Steve Dower <steve.dower@python.org> | 2019-06-24 15:42:54 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-24 15:42:54 (GMT) |
commit | 60419a7e96577cf783b3b45bf3984f9fb0d7ddff (patch) | |
tree | 2718cb915663c42902621491ba60accce6729d42 /Lib/ftplib.py | |
parent | 9bbf4d7083a819cbcee2a6cd3df2802d4c50f734 (diff) | |
download | cpython-60419a7e96577cf783b3b45bf3984f9fb0d7ddff.zip cpython-60419a7e96577cf783b3b45bf3984f9fb0d7ddff.tar.gz cpython-60419a7e96577cf783b3b45bf3984f9fb0d7ddff.tar.bz2 |
bpo-37363: Add audit events for a range of modules (GH-14301)
Diffstat (limited to 'Lib/ftplib.py')
-rw-r--r-- | Lib/ftplib.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/ftplib.py b/Lib/ftplib.py index a9b1aee..27bf6da 100644 --- a/Lib/ftplib.py +++ b/Lib/ftplib.py @@ -148,6 +148,7 @@ class FTP: self.timeout = timeout if source_address is not None: self.source_address = source_address + sys.audit("ftplib.FTP.connect", self, self.host, self.port) self.sock = socket.create_connection((self.host, self.port), self.timeout, source_address=self.source_address) self.af = self.sock.family @@ -188,6 +189,7 @@ class FTP: def putline(self, line): if '\r' in line or '\n' in line: raise ValueError('an illegal newline character should not be contained') + sys.audit("ftplib.FTP.sendcmd", self, line) line = line + CRLF if self.debugging > 1: print('*put*', self.sanitize(line)) |