mirror of
https://github.com/jkl1337/duplicacy.git
synced 2026-01-09 15:14:40 -06:00
The info command should not overwrite the default password if reset-passwords is on
This commit is contained in:
@@ -1122,6 +1122,7 @@ func infoStorage(context *cli.Context) {
|
|||||||
duplicacy.SetKeyringFile(path.Join(preferencePath, "keyring"))
|
duplicacy.SetKeyringFile(path.Join(preferencePath, "keyring"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resetPasswords := context.Bool("reset-passwords")
|
||||||
isEncrypted := context.Bool("e")
|
isEncrypted := context.Bool("e")
|
||||||
preference := duplicacy.Preference{
|
preference := duplicacy.Preference{
|
||||||
Name: "default",
|
Name: "default",
|
||||||
@@ -1131,12 +1132,18 @@ func infoStorage(context *cli.Context) {
|
|||||||
DoNotSavePassword: true,
|
DoNotSavePassword: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
password := ""
|
if resetPasswords {
|
||||||
if isEncrypted {
|
// We don't want password entered for the info command to overwrite the saved password for the default storage,
|
||||||
password = duplicacy.GetPassword(preference, "password", "Enter the storage password:", false, false)
|
// so we simply assign an empty name.
|
||||||
|
preference.Name = ""
|
||||||
}
|
}
|
||||||
|
|
||||||
storage := duplicacy.CreateStorage(preference, context.Bool("reset-passwords"), 1)
|
password := ""
|
||||||
|
if isEncrypted {
|
||||||
|
password = duplicacy.GetPassword(preference, "password", "Enter the storage password:", false, resetPasswords)
|
||||||
|
}
|
||||||
|
|
||||||
|
storage := duplicacy.CreateStorage(preference, resetPasswords, 1)
|
||||||
config, isStorageEncrypted, err := duplicacy.DownloadConfig(storage, password)
|
config, isStorageEncrypted, err := duplicacy.DownloadConfig(storage, password)
|
||||||
|
|
||||||
if isStorageEncrypted {
|
if isStorageEncrypted {
|
||||||
|
|||||||
Reference in New Issue
Block a user