8000 gh-133562: Skip security descriptors on unsupported Windows API parti… · python/cpython@e528aef · GitHub
[go: up one dir, main page]

Skip to content

Commit e528aef

Browse files
authored
gh-133562: Skip security descriptors on unsupported Windows API partitions (GH-133563)
1 parent 3e23047 commit e528aef

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Disable handling of security descriptors by :func:`os.mkdir` with mode ``0o700`` on WinAPI partitions that do not support it. This only affects custom builds for specialized targets.

Modules/posixmodule.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5736,6 +5736,9 @@ os_mkdir_impl(PyObject *module, path_t *path, int mode, int dir_fd)
57365736

57375737
#ifdef MS_WINDOWS
57385738
Py_BEGIN_ALLOW_THREADS
5739+
// For API sets that don't support these APIs, we have no choice
5740+
// but to silently create a directory with default ACL.
5741+
#if defined(MS_WINDOWS_APP) || defined(MS_WINDOWS_SYSTEM)
57395742
if (mode == 0700 /* 0o700 */) {
57405743
ULONG sdSize;
57415744
pSecAttr = &secAttr;
@@ -5751,6 +5754,7 @@ os_mkdir_impl(PyObject *module, path_t *path, int mode, int dir_fd)
57515754
error = GetLastError();
57525755
}
57535756
}
5757+
#endif
57545758
if (!error) {
57555759
result = CreateDirectoryW(path->wide, pSecAttr);
57565760
if (secAttr.lpSecurityDescriptor &&

0 commit comments

Comments
 (0)
0