Skip to content

Commit 771e323

Browse files
committed
gh-158998: Fix os.statx() ignoring follow_symlinks=False
1 parent 15dd735 commit 771e323

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎Modules/posixmodule.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3669,6 +3669,9 @@ os_statx_impl(PyObject *module, path_t *path, unsigned int mask, int flags,
36693669
"use dir_fd kwarg instead of AT_EMPTY_PATH flag");
36703670
return NULL;
36713671
}
3672+
if (!follow_symlinks) {
3673+
flags |= AT_SYMLINK_NOFOLLOW;
3674+
}
36723675

36733676
/* Future bits may refer to members beyond the current size of struct
36743677
statx, so we need to mask them off to prevent memory corruption. */

0 commit comments

Comments
 (0)