mirror of
https://github.com/gilbertchen/duplicacy
synced 2025-12-06 00:03:38 +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 == "" {
|
if value == "" {
|
||||||
keyring[key] = nil
|
keyring[key] = nil
|
||||||
} else {
|
} 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))
|
encryptedValue, err := keyringEncrypt([]byte(value))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
LOG_DEBUG("KEYRING_ENCRYPT", "Failed to encrypt the value: %v", err)
|
LOG_DEBUG("KEYRING_ENCRYPT", "Failed to encrypt the value: %v", err)
|
||||||
|
|||||||
Reference in New Issue
Block a user