Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix TOCTOU in create_dirs_impl #73

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nextsilicon-itay-bookstein
Copy link
Contributor

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.

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.

Signed-off-by: Itay Bookstein <[email protected]>
@codecov
Copy link

codecov bot commented Feb 9, 2021

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%) ⬇️

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant