Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e528aef

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

File tree

2 files changed

+5
-0
lines changed
Filter options

2 files changed

+5
-0
lines changed
+1Lines 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

Copy file name to clipboardExpand all lines: Modules/posixmodule.c
+4Lines 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.