Skip to content

Commit 943a77e

Browse files
server/migration: Remove unnecessary name parameter
1 parent fd1ee1b commit 943a77e

3 files changed

Lines changed: 6 additions & 13 deletions

File tree

server/src/migration.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,10 @@ impl PendingMigration {
3131
pub async fn migrate(
3232
&self,
3333
data_dir: &PathBuf,
34-
name: &str,
3534
secret: &Secret,
3635
) -> Result<UnlockedKeyring, Error> {
3736
match self {
38-
Self::V0 { path, .. } => {
37+
Self::V0 { path, name, .. } => {
3938
tracing::debug!("Migrating v0 keyring: {}", name);
4039

4140
let unlocked = UnlockedKeyring::open_at(data_dir, name, secret.clone()).await?;
@@ -55,7 +54,7 @@ impl PendingMigration {
5554
Ok(unlocked)
5655
}
5756
#[cfg(feature = "kwallet_migration")]
58-
Self::KWallet { path, .. } => {
57+
Self::KWallet { path, name, .. } => {
5958
tracing::debug!("Migrating KWallet keyring: {}", name);
6059

6160
// Parse KWallet file in blocking task

server/src/service/mod.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -263,10 +263,7 @@ impl Service {
263263
);
264264

265265
// Attempt migration with the provided secret (no locks held)
266-
match migration
267-
.migrate(&service.data_dir, migration_name, &secret)
268-
.await
269-
{
266+
match migration.migrate(&service.data_dir, &secret).await {
270267
Ok(unlocked_keyring) => {
271268
tracing::info!(
272269
"Successfully migrated '{}' during unlock",
@@ -796,7 +793,7 @@ impl Service {
796793

797794
if let Some(secret) = secret {
798795
tracing::debug!("Attempting immediate migration of KWallet keyring '{name}'",);
799-
match migration.migrate(&self.data_dir, name, secret).await {
796+
match migration.migrate(&self.data_dir, secret).await {
800797
Ok(unlocked) => {
801798
tracing::info!("Successfully migrated KWallet keyring '{name}' to oo7",);
802799
discovered.push((
@@ -1388,7 +1385,7 @@ impl Service {
13881385
for (name, migration) in pending.iter() {
13891386
tracing::debug!("Attempting to migrate pending keyring: {name}");
13901387

1391-
match migration.migrate(&self.data_dir, name, secret).await {
1388+
match migration.migrate(&self.data_dir, secret).await {
13921389
Ok(unlocked) => {
13931390
let label = migration.label();
13941391
let alias = migration.alias();

server/src/tests.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@ use base64::Engine;
55
use oo7::{Secret, crypto, dbus};
66
use rustix::net::{AddressFamily, SocketFlags, SocketType, socketpair};
77
use tokio_stream::StreamExt;
8-
use zbus::{
9-
proxy::Defaults,
10-
zvariant::{Fd, ObjectPath, Optional, Value},
11-
};
8+
use zbus::zvariant::{Fd, ObjectPath, Optional, Value};
129

1310
#[cfg(any(feature = "gnome_native_crypto", feature = "gnome_openssl_crypto"))]
1411
use crate::gnome::{

0 commit comments

Comments
 (0)