]> Untitled Git - bdk/commit
fix(store): replace `Path.exists` by `OpenOptions.create_new`
authornymius <155548262+nymius@users.noreply.github.com>
Tue, 12 Nov 2024 18:56:34 +0000 (15:56 -0300)
committernymius <155548262+nymius@users.noreply.github.com>
Wed, 5 Mar 2025 23:49:53 +0000 (10:49 +1100)
commit39987882b90b5ddaef3b5ebfc01c5c6e2cb6c0d7
tree98bc5f7f7ea01a7e709e1e543a9d0ce4ffd5ff3d
parent362c3dc85d469efbfe2046e7b02f9ca8ff64cb03
fix(store): replace `Path.exists` by `OpenOptions.create_new`

`Path.exists` is not safe against time-of-creation, time-of-use (TOCTOU)
bugs.

`OpenOptions.create_new` on the other hand is atomic, so not prone to
this kind of problems.
crates/file_store/src/store.rs