bpo-39184: Add audit events to command execution functions in os and pty modules (GH-17824)

This commit is contained in:
Saiyang Gou 2020-02-04 16:15:00 -08:00 committed by GitHub
parent 40e547dfbb
commit 95f6001021
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 56 additions and 7 deletions

View file

@ -8,6 +8,7 @@
from select import select
import os
import sys
import tty
__all__ = ["openpty","fork","spawn"]
@ -151,6 +152,7 @@ def spawn(argv, master_read=_read, stdin_read=_read):
"""Create a spawned process."""
if type(argv) == type(''):
argv = (argv,)
sys.audit('pty.spawn', argv)
pid, master_fd = fork()
if pid == CHILD:
os.execlp(argv[0], *argv)