Re: [PATCH proxmox-backup v2 06/27] pbs-config: implement encryption key config handling

Christian Ebner
2026-04-13T08:05:44Z

On 4/11/26 10:50 AM, Thomas Lamprecht wrote:
>
>> + replace_backup_config(ENCRYPTION_KEYS_CFG_FILENAME, raw.as_bytes())?;
>> +
>> + // drop key file lock
>> + std::fs::remove_file(key_path)?;
>
> nit: if remove_file fails here, the config was already updated (key section
> removed). Not dangerous since the key is no longer referenced, but you'd leave
> a stale .enc file. Maybe just log a warning and return Ok instead of
> propagating the error?

Here I'm a bit unsure: The intention was to have an error, so the user
is primed to look at why the key file removal failed. Just logging a
warning might be easily missed, this does not run inside a task with log
context after all. And one would expect that the key is removed from the
filesystem, not just from the config, expecting it to not be (easily)
recoverable?