mirror of
https://github.com/borgbackup/borg.git
synced 2025-02-24 15:12:00 +00:00
SecurityManager.known(): check all files, fixes #4614
Before this fix, because known() only checked the key-type file, the
location file could go missing without being automatically regenerated.
Now a save() is triggered if not all files are present.
(cherry picked from commit c68cad9727
)
This commit is contained in:
parent
e299ad824c
commit
9c3a572638
1 changed files with 2 additions and 1 deletions
|
@ -73,7 +73,8 @@ def destroy(repository, path=None):
|
||||||
shutil.rmtree(path)
|
shutil.rmtree(path)
|
||||||
|
|
||||||
def known(self):
|
def known(self):
|
||||||
return os.path.exists(self.key_type_file)
|
return all(os.path.exists(f)
|
||||||
|
for f in (self.key_type_file, self.location_file, self.manifest_ts_file))
|
||||||
|
|
||||||
def key_matches(self, key):
|
def key_matches(self, key):
|
||||||
if not self.known():
|
if not self.known():
|
||||||
|
|
Loading…
Reference in a new issue