summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2012-01-24 08:05:18 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2012-01-24 08:05:18 (GMT)
commit91ecea24f53b99aa190f6b17c2b51d95cb09d233 (patch)
tree223a4b5fa95e535f8fa16560cea1eaa748e8ef7d /Modules
parent09406023a8c19febb3358008ddeabe4450c21b79 (diff)
parent5311c1d7ab24f862b9b0bb272a9aee9c4f4ac023 (diff)
downloadcpython-91ecea24f53b99aa190f6b17c2b51d95cb09d233.zip
cpython-91ecea24f53b99aa190f6b17c2b51d95cb09d233.tar.gz
cpython-91ecea24f53b99aa190f6b17c2b51d95cb09d233.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 61a0439..1797a2f 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -6551,7 +6551,6 @@ win_symlink(PyObject *self, PyObject *args, PyObject *kwargs)
wchar_t *wsrc, *wdest;
int target_is_directory = 0;
DWORD res;
- WIN32_FILE_ATTRIBUTE_DATA src_info;
if (!check_CreateSymbolicLinkW())
{
@@ -6581,16 +6580,6 @@ win_symlink(PyObject *self, PyObject *args, PyObject *kwargs)
if (wsrc == NULL)
goto error;
- /* if src is a directory, ensure target_is_directory==1 */
- if(
- GetFileAttributesExW(
- wsrc, GetFileExInfoStandard, &src_info
- ))
- {
- target_is_directory = target_is_directory ||
- (src_info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY);
- }
-
Py_BEGIN_ALLOW_THREADS
res = Py_CreateSymbolicLinkW(wdest, wsrc, target_is_directory);
Py_END_ALLOW_THREADS