Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Revert auditing changes.
  • Loading branch information
serhiy-storchaka committed Dec 13, 2023
commit 3f3e25a8886346b858f502d06e9d65feabf3525c
6 changes: 3 additions & 3 deletions Doc/library/os.rst
Original file line number Diff line number Diff line change
Expand Up @@ -999,7 +999,7 @@ as internal buffering of data.
docs for :func:`chmod` for possible values of *mode*. As of Python 3.3, this
is equivalent to ``os.chmod(fd, mode)``.

.. audit-event:: os.chmod path,mode,dir_fd,follow_symlinks os.fchmod
.. audit-event:: os.chmod path,mode,dir_fd os.fchmod

.. availability:: Unix.

Expand Down Expand Up @@ -2067,7 +2067,7 @@ features:
The function is limited on Emscripten and WASI, see
:ref:`wasm-availability` for more information.

.. audit-event:: os.chmod path,mode,dir_fd,follow_symlinks os.chmod
.. audit-event:: os.chmod path,mode,dir_fd os.chmod

.. versionadded:: 3.3
Added support for specifying *path* as an open file descriptor,
Expand Down Expand Up @@ -2164,7 +2164,7 @@ features:
for possible values of *mode*. As of Python 3.3, this is equivalent to
``os.chmod(path, mode, follow_symlinks=False)``.

.. audit-event:: os.chmod path,mode,dir_fd,follow_symlinks os.lchmod
.. audit-event:: os.chmod path,mode,dir_fd os.lchmod

.. availability:: Unix, Windows.

Expand Down
9 changes: 4 additions & 5 deletions Modules/posixmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -3384,9 +3384,8 @@ os_chmod_impl(PyObject *module, path_t *path, int mode, int dir_fd,
return NULL;
#endif

if (PySys_Audit("os.chmod", "OiiO", path->object, mode,
dir_fd == DEFAULT_DIR_FD ? -1 : dir_fd,
follow_symlinks ? Py_True : Py_False) < 0) {
if (PySys_Audit("os.chmod", "Oii", path->object, mode,
dir_fd == DEFAULT_DIR_FD ? -1 : dir_fd) < 0) {
return NULL;
}

Expand Down Expand Up @@ -3531,7 +3530,7 @@ os_fchmod_impl(PyObject *module, int fd, int mode)
int res;
int async_err = 0;

if (PySys_Audit("os.chmod", "iiiO", fd, mode, -1, Py_False) < 0) {
if (PySys_Audit("os.chmod", "iii", fd, mode, -1) < 0) {
return NULL;
}

Expand Down Expand Up @@ -3566,7 +3565,7 @@ os_lchmod_impl(PyObject *module, path_t *path, int mode)
/*[clinic end generated code: output=082344022b51a1d5 input=90c5663c7465d24f]*/
{
int res;
if (PySys_Audit("os.chmod", "OiiO", path->object, mode, -1, Py_False) < 0) {
if (PySys_Audit("os.chmod", "Oii", path->object, mode, -1) < 0) {
return NULL;
}
#ifdef MS_WINDOWS
Expand Down