From f8358bd17eece8e25ae7723237bc1cfc55f595cd Mon Sep 17 00:00:00 2001 From: fufesou Date: Mon, 23 Mar 2026 16:33:26 +0800 Subject: [PATCH] fix(password): set_salt(), check if is empty, fix condition Signed-off-by: fufesou --- src/config.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/config.rs b/src/config.rs index eeaced127..2922906f4 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1346,16 +1346,16 @@ impl Config { } if !password_is_empty_or_not_hashed(&config.password) { if config.salt.is_empty() { - log::error!( - "Refusing to set salt because permanent password is hashed and salt is empty" - ); - return; - } else { // This shouldn't happen under normal circumstances because the salt // should be automatically generated when migrating to hash storage. // However, if it does occur, it's best to log the error, // even though this will result in logging many duplicate error messages. log::warn!("Salt is empty but permanent password is hashed"); + } else { + log::error!( + "Refusing to set salt because permanent password is hashed and salt is empty" + ); + return; } } config.salt = salt.into();