spdlog_setup icon indicating copy to clipboard operation
spdlog_setup copied to clipboard

Fix TOCTOU in create_dirs_impl

Open nextsilicon-itay-bookstein opened this issue 3 years ago • 1 comments

Replace the check whether a directory exists before trying to create it with handling for already-exists cases. This addresses a race where the directory is created by another process, leading to a failure.

This happened when multiple processes were started up simultaneously with configurations that lead to the creation of the same parent directory.

Codecov Report

Merging #73 (0162cc0) into master (a991861) will decrease coverage by 0.35%. The diff coverage is 62.50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #73      +/-   ##
==========================================
- Coverage   88.16%   87.80%   -0.36%     
==========================================
  Files           4        4              
  Lines         566      566              
==========================================
- Hits          499      497       -2     
- Misses         67       69       +2     
Impacted Files Coverage Δ
include/spdlog_setup/details/conf_impl.h 89.63% <62.50%> (-0.52%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update a991861...0162cc0. Read the comment docs.

codecov[bot] avatar Feb 09 '21 11:02 codecov[bot]