mirror of
https://github.com/python/cpython.git
synced 2025-07-07 19:35:27 +00:00
gh-133562: Skip security descriptors on unsupported Windows API partitions (GH-133563)
This commit is contained in:
parent
3e23047363
commit
e528aef7e2
2 changed files with 5 additions and 0 deletions
|
@ -0,0 +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.
|
|
@ -5736,6 +5736,9 @@ os_mkdir_impl(PyObject *module, path_t *path, int mode, int dir_fd)
|
|||
|
||||
#ifdef MS_WINDOWS
|
||||
Py_BEGIN_ALLOW_THREADS
|
||||
// For API sets that don't support these APIs, we have no choice
|
||||
// but to silently create a directory with default ACL.
|
||||
#if defined(MS_WINDOWS_APP) || defined(MS_WINDOWS_SYSTEM)
|
||||
if (mode == 0700 /* 0o700 */) {
|
||||
ULONG sdSize;
|
||||
pSecAttr = &secAttr;
|
||||
|
@ -5751,6 +5754,7 @@ os_mkdir_impl(PyObject *module, path_t *path, int mode, int dir_fd)
|
|||
error = GetLastError();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (!error) {
|
||||
result = CreateDirectoryW(path->wide, pSecAttr);
|
||||
if (secAttr.lpSecurityDescriptor &&
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue