summaryrefslogtreecommitdiffstats
path: root/PC
diff options
context:
space:
mode:
authorSaiyang Gou <gousaiyang@163.com>2020-02-13 07:47:42 (GMT)
committerGitHub <noreply@github.com>2020-02-13 07:47:42 (GMT)
commit7514f4f6254f4a2d13ea8e5632a8e5f22b637e0b (patch)
tree9010a9077eaee0c66eea85e36f60086de6fba731 /PC
parent597ebed748d0b0c061f8c108bd98270d103286c1 (diff)
downloadcpython-7514f4f6254f4a2d13ea8e5632a8e5f22b637e0b.zip
cpython-7514f4f6254f4a2d13ea8e5632a8e5f22b637e0b.tar.gz
cpython-7514f4f6254f4a2d13ea8e5632a8e5f22b637e0b.tar.bz2
bpo-39184: Add audit events to functions in `fcntl`, `msvcrt`, `os`, `resource`, `shutil`, `signal`, `syslog` (GH-18407)
Diffstat (limited to 'PC')
-rw-r--r--PC/msvcrtmodule.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/PC/msvcrtmodule.c b/PC/msvcrtmodule.c
index c4113e5..5c06ec2 100644
--- a/PC/msvcrtmodule.c
+++ b/PC/msvcrtmodule.c
@@ -116,6 +116,10 @@ msvcrt_locking_impl(PyObject *module, int fd, int mode, long nbytes)
{
int err;
+ if (PySys_Audit("msvcrt.locking", "iil", fd, mode, nbytes) < 0) {
+ return NULL;
+ }
+
Py_BEGIN_ALLOW_THREADS
_Py_BEGIN_SUPPRESS_IPH
err = _locking(fd, mode, nbytes);
@@ -175,6 +179,10 @@ msvcrt_open_osfhandle_impl(PyObject *module, void *handle, int flags)
{
int fd;
+ if (PySys_Audit("msvcrt.open_osfhandle", "Ki", handle, flags) < 0) {
+ return NULL;
+ }
+
_Py_BEGIN_SUPPRESS_IPH
fd = _open_osfhandle((intptr_t)handle, flags);
_Py_END_SUPPRESS_IPH
@@ -201,6 +209,10 @@ msvcrt_get_osfhandle_impl(PyObject *module, int fd)
{
intptr_t handle = -1;
+ if (PySys_Audit("msvcrt.get_osfhandle", "(i)", fd) < 0) {
+ return NULL;
+ }
+
_Py_BEGIN_SUPPRESS_IPH
handle = _get_osfhandle(fd);
_Py_END_SUPPRESS_IPH