Skip to content

Fixes BORG_CACHE_DIR crashing borg if empty#5485

Merged
ThomasWaldmann merged 8 commits intoborgbackup:masterfrom
Gu1nness:#5216-BORG_CACHE_DIR
Nov 22, 2020
Merged

Fixes BORG_CACHE_DIR crashing borg if empty#5485
ThomasWaldmann merged 8 commits intoborgbackup:masterfrom
Gu1nness:#5216-BORG_CACHE_DIR

Conversation

@Gu1nness
Copy link
Contributor

@Gu1nness Gu1nness commented Nov 4, 2020

This patch introduces a new function that atomically checks if the given
directory exists or not, and if not, tries to fix it.
The error is reraised if necessary with a nice catching.

Fixes #5216.

This patch introduces a new function that atomically checks if the given
directory exists or not, and if not, tries to fix it.
Still have a problem when reraising the error to remove the traceback.
Copy link
Member

@ThomasWaldmann ThomasWaldmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the PR!

i mainly commented on the new function, let's first improve that one.

@Gu1nness
Copy link
Contributor Author

Gu1nness commented Nov 5, 2020

Thanks for all these comments, I will make the changes you requested ASAP :)

@Gu1nness Gu1nness closed this Nov 5, 2020
@Gu1nness Gu1nness reopened this Nov 5, 2020
@Gu1nness
Copy link
Contributor Author

Sorry I quite forgot about this issue, I will fix the last few things tonight.

Update the docstring, the return value and removes the tests of return
of `ensure_dir`
Copy link
Member

@ThomasWaldmann ThomasWaldmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we're almost there!

@ThomasWaldmann ThomasWaldmann merged commit fc92587 into borgbackup:master Nov 22, 2020
@ThomasWaldmann
Copy link
Member

Thanks! Do you want to backport to 1.1-maint?

@Gu1nness
Copy link
Contributor Author

Sure, I'll backport it!

@ThomasWaldmann ThomasWaldmann mentioned this pull request Feb 28, 2021
ThomasWaldmann added a commit to ThomasWaldmann/borg that referenced this pull request Apr 19, 2021
ThomasWaldmann added a commit to ThomasWaldmann/borg that referenced this pull request Apr 19, 2021
this bug was introduced by PR borgbackup#5485 and also affects backport PR borgbackup#5774.
ThomasWaldmann added a commit to ThomasWaldmann/borg that referenced this pull request Apr 19, 2021
this bug was introduced by PR borgbackup#5485 and also affects backport PR borgbackup#5774.
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.

Setting BORG_CACHE_DIR to an empty string crashes borg

2 participants