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
{{ message }}
Repository navigation
TOCTOU: File deletion followed by file creation #17153
Detect when a file is being deleted and then the same file path is used to create a new file. This is a classic source of Time Of Check, Time Of Use bugs.
Advantage
The recommended code deletes and recreates an empty file in a single syscall, meaning that the act of creation acts as the check, avoiding TOCTOU bugs.
Drawbacks
No response
Example
We should detect when an argument to std::fs::remove_file is used later to create a File:
let path = "foo";
fs::remove_file(path)?;
fs::File::create(path)?;
We should detect when string literals are used too:
Activity
Rollup merge of rust-lang#160489 - asder8215:fs_diagnostic_items, r=m…
Rollup merge of rust-lang#160489 - asder8215:fs_diagnostic_items, r=m…
Rollup merge of rust-lang#160489 - asder8215:fs_diagnostic_items, r=m…
Rollup merge of rust-lang#160489 - asder8215:fs_diagnostic_items, r=m…
Unrolled build for #160489
Rollup merge of #160489 - asder8215:fs_diagnostic_items, r=mejrs
Rollup merge of #160489 - asder8215:fs_diagnostic_items, r=mejrs