mirror of
https://github.com/gilbertchen/duplicacy
synced 2025-12-10 05:13:17 +00:00
Do not update the Windows keyring file if the password remains unchanged
This commit is contained in:
@@ -136,6 +136,16 @@ func keyringSet(key string, value string) bool {
|
||||
if value == "" {
|
||||
keyring[key] = nil
|
||||
} else {
|
||||
|
||||
// Check if the value to be set is the same as the existing one
|
||||
existingEncryptedValue := keyring[key]
|
||||
if len(existingEncryptedValue) > 0 {
|
||||
existingValue, err := keyringDecrypt(existingEncryptedValue)
|
||||
if err == nil && string(existingValue) == value {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
encryptedValue, err := keyringEncrypt([]byte(value))
|
||||
if err != nil {
|
||||
LOG_DEBUG("KEYRING_ENCRYPT", "Failed to encrypt the value: %v", err)
|
||||
|
||||
Reference in New Issue
Block a user