Files
restic/changelog
Ion 2991718398 repository: save config before key file during init (#21944)
restic init generated and uploaded the key file first and only saved the
config afterwards. If two clients ran init against the same empty
repository location at nearly the same time, the backend could end up
with two key files but only one config file, since backends that reject
overwrites let only one of the two config writes succeed. The losing
client's key file stayed in the repository without ever belonging to a
valid config, so clients picking that key later would fail with a
"config or key ... is damaged" error instead of a clear diagnostic.

Reorder Repository.init so the config is saved before the key file is
uploaded. To make that possible, AddKey no longer generates a random
master key internally; callers now supply the master key to encrypt and
store. The two other callers of AddKey (key add, key passwd) already had
an existing key available and pass that through unchanged.
2026-11-22 16:49:09 +00:00
..
2021-08-21 12:16:04 +02:00
2023-12-06 13:11:55 +01:00
2023-12-06 13:11:55 +01:00
2023-12-06 13:11:55 +01:00
2018-06-10 11:29:57 +02:00
2023-12-06 13:11:55 +01:00
2023-12-06 13:11:55 +01:00
2024-03-11 14:35:12 +08:00
2023-10-27 19:48:00 +02:00
2025-09-06 21:59:11 +02:00
2024-01-08 21:33:05 +01:00