1
0
Fork 0
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:
Thomas Waldmann 2019-06-25 23:15:13 +02:00 committed by Saurav Sachidanand
parent e299ad824c
commit 9c3a572638

View file

@ -73,7 +73,8 @@ def destroy(repository, path=None):
shutil.rmtree(path)
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):
if not self.known():