From 001b80305addc5e47a1c80f6629a757178d95c81 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Thu, 11 Jul 2013 09:48:07 +0200 Subject: [PATCH] QDir::mkpath shouldn't fail if parent directory denies access The fix for QTBUG-30046 introduced this regression on Windows, which meant that it became impossible to create a directory anywhere under c:\Users for example, because each user only has permission to see his own directory. Task-number: QTBUG-32314 Change-Id: I1b35433265934d4978d4b0c23a946c3f920c710d Reviewed-by: Friedemann Kleint --- src/corelib/io/qfilesystemengine_win.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/corelib/io/qfilesystemengine_win.cpp b/src/corelib/io/qfilesystemengine_win.cpp index 2c9ed9da3d..e8904b0ab7 100644 --- a/src/corelib/io/qfilesystemengine_win.cpp +++ b/src/corelib/io/qfilesystemengine_win.cpp @@ -1049,7 +1049,8 @@ bool QFileSystemEngine::createDirectory(const QFileSystemEntry &entry, bool crea if (slash) { QString chunk = dirName.left(slash); if (!mkDir(chunk)) { - if (GetLastError() == ERROR_ALREADY_EXISTS) { + const DWORD lastError = GetLastError(); + if (lastError == ERROR_ALREADY_EXISTS || lastError == ERROR_ACCESS_DENIED) { bool existed = false; if (isDirPath(chunk, &existed) && existed) continue;