diff options
author | Saiyang Gou <gousaiyang@163.com> | 2020-02-12 23:47:42 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-13 07:47:42 +0000 |
commit | 7514f4f6254f4a2d13ea8e5632a8e5f22b637e0b (patch) | |
tree | 9010a9077eaee0c66eea85e36f60086de6fba731 /Modules/resource.c | |
parent | 597ebed748d0b0c061f8c108bd98270d103286c1 (diff) | |
download | cpython-git-7514f4f6254f4a2d13ea8e5632a8e5f22b637e0b.tar.gz |
bpo-39184: Add audit events to functions in `fcntl`, `msvcrt`, `os`, `resource`, `shutil`, `signal`, `syslog` (GH-18407)
Diffstat (limited to 'Modules/resource.c')
-rw-r--r-- | Modules/resource.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Modules/resource.c b/Modules/resource.c index 87c72e7409..afde03c6c7 100644 --- a/Modules/resource.c +++ b/Modules/resource.c @@ -224,6 +224,11 @@ resource_setrlimit_impl(PyObject *module, int resource, PyObject *limits) return NULL; } + if (PySys_Audit("resource.setrlimit", "iO", resource, + limits ? limits : Py_None) < 0) { + return NULL; + } + if (py2rlimit(limits, &rl) < 0) { return NULL; } @@ -269,6 +274,11 @@ resource_prlimit_impl(PyObject *module, pid_t pid, int resource, return NULL; } + if (PySys_Audit("resource.prlimit", "iiO", pid, resource, + limits ? limits : Py_None) < 0) { + return NULL; + } + if (group_right_1) { if (py2rlimit(limits, &new_limit) < 0) { return NULL; |