Spiegel von
https://github.com/dani-garcia/vaultwarden.git
synchronisiert 2024-11-26 05:50:29 +01:00
Fix importing Bitwarden exports (#4030)
When importing Bitwarden JSON exports, these would fail because the last modification date was also imported and caused our out-off-sync check to kick-in. This PR fixes this by checking if we are doing an import, and skip this check. Fixes #4005
Dieser Commit ist enthalten in:
Ursprung
512b3b9b7c
Commit
cec1e87679
1 geänderte Dateien mit 10 neuen und 7 gelöschten Zeilen
|
@ -359,14 +359,17 @@ pub async fn update_cipher_from_data(
|
||||||
enforce_personal_ownership_policy(Some(&data), headers, conn).await?;
|
enforce_personal_ownership_policy(Some(&data), headers, conn).await?;
|
||||||
|
|
||||||
// Check that the client isn't updating an existing cipher with stale data.
|
// Check that the client isn't updating an existing cipher with stale data.
|
||||||
if let Some(dt) = data.LastKnownRevisionDate {
|
// And only perform this check when not importing ciphers, else the date/time check will fail.
|
||||||
match NaiveDateTime::parse_from_str(&dt, "%+") {
|
if ut != UpdateType::None {
|
||||||
// ISO 8601 format
|
if let Some(dt) = data.LastKnownRevisionDate {
|
||||||
Err(err) => warn!("Error parsing LastKnownRevisionDate '{}': {}", dt, err),
|
match NaiveDateTime::parse_from_str(&dt, "%+") {
|
||||||
Ok(dt) if cipher.updated_at.signed_duration_since(dt).num_seconds() > 1 => {
|
// ISO 8601 format
|
||||||
err!("The client copy of this cipher is out of date. Resync the client and try again.")
|
Err(err) => warn!("Error parsing LastKnownRevisionDate '{}': {}", dt, err),
|
||||||
|
Ok(dt) if cipher.updated_at.signed_duration_since(dt).num_seconds() > 1 => {
|
||||||
|
err!("The client copy of this cipher is out of date. Resync the client and try again.")
|
||||||
|
}
|
||||||
|
Ok(_) => (),
|
||||||
}
|
}
|
||||||
Ok(_) => (),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Laden …
In neuem Issue referenzieren