From 0fbcc11f996a60270223e9c95013b36b55cb8622 Mon Sep 17 00:00:00 2001 From: J M <2364004+Blu-J@users.noreply.github.com> Date: Thu, 23 Jun 2022 10:25:47 -0600 Subject: [PATCH] fix: Make it so we only need the password on the backup (#1566) * fix: Make it so we only need the password on the backup * chore: Remove the rewrite of password --- backend/src/backup/restore.rs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/backend/src/backup/restore.rs b/backend/src/backup/restore.rs index bcbc73fc8..9b27fc10a 100644 --- a/backend/src/backup/restore.rs +++ b/backend/src/backup/restore.rs @@ -44,27 +44,22 @@ fn parse_comma_separated(arg: &str, _: &ArgMatches<'_>) -> Result } #[command(rename = "restore", display(display_none))] -#[instrument(skip(ctx, old_password, password))] +#[instrument(skip(ctx, password))] pub async fn restore_packages_rpc( #[context] ctx: RpcContext, #[arg(parse(parse_comma_separated))] ids: Vec, #[arg(rename = "target-id")] target_id: BackupTargetId, - #[arg(rename = "old-password", long = "old-password")] old_password: Option, #[arg] password: String, ) -> Result, Error> { let mut db = ctx.db.handle(); - check_password_against_db(&mut ctx.secret_store.acquire().await?, &password).await?; let fs = target_id .load(&mut ctx.secret_store.acquire().await?) .await?; - let mut backup_guard = BackupMountGuard::mount( + let backup_guard = BackupMountGuard::mount( TmpMountGuard::mount(&fs, ReadOnly).await?, - old_password.as_ref().unwrap_or(&password), + &password, ) .await?; - if old_password.is_some() { - backup_guard.change_password(&password)?; - } let (revision, backup_guard, tasks, _) = restore_packages(&ctx, &mut db, backup_guard, ids).await?;