From db689f3c3c2257763d19f58c1522a8ba28a39d94 Mon Sep 17 00:00:00 2001 From: morluto <76467478+morluto@users.noreply.github.com> Date: Thu, 15 Oct 2026 08:35:11 +0800 Subject: [PATCH] fix(windows): relax owned parent sharing before admission validation --- native/windows/src/filesystem.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/native/windows/src/filesystem.cc b/native/windows/src/filesystem.cc index ab67325d55..edecb1978a 100644 --- a/native/windows/src/filesystem.cc +++ b/native/windows/src/filesystem.cc @@ -386,9 +386,11 @@ void createRuntime(const std::wstring& parentPath, const std::wstring& prefix, owner->directory = createRelative(owner->parents.back().get(), name, DELETE | FILE_LIST_DIRECTORY | FILE_READ_ATTRIBUTES | FILE_WRITE_ATTRIBUTES | READ_CONTROL, true, security, owner->path); - verifyPrivate(owner->directory.get(), owner->path, true); - // The owned child pins the parent nonempty before write sharing is relaxed. + // FILE_CREATE proves ownership and pins the parent nonempty independently + // of admission validation. A failed validation must not retain a strict + // parent lease that prevents renaming the still-owned child before retry. owner->parents.back() = openComponent(parent->path, 0, true, FILE_SHARE_READ | FILE_SHARE_WRITE); + verifyPrivate(owner->directory.get(), owner->path, true); } catch (Failure& primary) { cleanupFailedRuntime(owner, primary); throw;