Przeglądaj źródła

ignore EACCES (errno 13) when hardlinking, fixes #4730

we create the hardlink to be able to secure erase the old config file.

if we can't do that because there is just a problem with hardlinks not
working, the old config will be just overwritten normally (not secure
erased). the user will get a warning in that case, but other than that,
the overall borg operation will succeed.

if there is a bigger problem (like a general lack of permissions or a
general issue with the underlying fs), subsequent operations will fail.
Thomas Waldmann 5 lat temu
rodzic
commit
851db7fe21
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      src/borg/repository.py

+ 1 - 1
src/borg/repository.py

@@ -298,7 +298,7 @@ class Repository:
             try:
             try:
                 os.link(config_path, old_config_path)
                 os.link(config_path, old_config_path)
             except OSError as e:
             except OSError as e:
-                if e.errno in (errno.EMLINK, errno.ENOSYS, errno.EPERM, errno.ENOTSUP):
+                if e.errno in (errno.EMLINK, errno.ENOSYS, errno.EPERM, errno.EACCES, errno.ENOTSUP):
                     logger.warning("Failed to securely erase old repository config file (hardlinks not supported>). "
                     logger.warning("Failed to securely erase old repository config file (hardlinks not supported>). "
                                    "Old repokey data, if any, might persist on physical storage.")
                                    "Old repokey data, if any, might persist on physical storage.")
                 else:
                 else: