You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SR-12272FileManager temporary directory creation not thread-safe on Linux
Issue Description:
In concurrent code, FileManager.createDirectory can throw fileWriteFileExists even when withIntermediateDirectories is true, which is a violation of the documented API contract.
This happens because the implementation falls for the classic check-then-run concurrency trap and does not double-check the result of mkdir. On macOS, this was fixed in rdar://23925981.
Additional Detail from JIRA
md5: ac32b4e0e0c5550241eb96ad90efcbf7
relates to:
FileManager
temporary directory creation not thread-safe on LinuxIssue Description:
In concurrent code, FileManager.createDirectory can throw fileWriteFileExists even when withIntermediateDirectories is true, which is a violation of the documented API contract.
This happens because the implementation falls for the classic check-then-run concurrency trap and does not double-check the result of mkdir. On macOS, this was fixed in rdar://23925981.
swift-corelibs-foundation/Sources/Foundation/FileManager+POSIX.swift
Line 339 in 14f0c8a
The code should check for EEXISTS before throwing.
The text was updated successfully, but these errors were encountered: