summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2012-01-24 07:59:28 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2012-01-24 07:59:28 (GMT)
commit5311c1d7ab24f862b9b0bb272a9aee9c4f4ac023 (patch)
treeaef57f35c7e9b616acf4597f63a8165e0d55491f /Modules
parent3b65fd7e9784967567e66bd67e9205cbb0d53d3a (diff)
downloadcpython-5311c1d7ab24f862b9b0bb272a9aee9c4f4ac023.zip
cpython-5311c1d7ab24f862b9b0bb272a9aee9c4f4ac023.tar.gz
cpython-5311c1d7ab24f862b9b0bb272a9aee9c4f4ac023.tar.bz2
Issue #13772: In os.symlink() under Windows, do not try to guess the link
target's type (file or directory). The detection was buggy and made the call non-atomic (therefore prone to race conditions).
Diffstat (limited to 'Modules')
-rw-r--r--Modules/posixmodule.c11
1 files changed, 0 insertions, 11 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 673877a..0afab3c 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -5330,7 +5330,6 @@ win_symlink(PyObject *self, PyObject *args, PyObject *kwargs)
PyObject *src, *dest;
int target_is_directory = 0;
DWORD res;
- WIN32_FILE_ATTRIBUTE_DATA src_info;
if (!check_CreateSymbolicLinkW())
{
@@ -5351,16 +5350,6 @@ win_symlink(PyObject *self, PyObject *args, PyObject *kwargs)
return NULL;
}
- /* if src is a directory, ensure target_is_directory==1 */
- if(
- GetFileAttributesExW(
- PyUnicode_AsUnicode(src), GetFileExInfoStandard, &src_info
- ))
- {
- target_is_directory = target_is_directory ||
- (src_info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY);
- }
-
Py_BEGIN_ALLOW_THREADS
res = Py_CreateSymbolicLinkW(
PyUnicode_AsUnicode(dest),