Fix forgetting password from keyring

First, Item.Delete never accepted any arguments, so this code likely
never worked.

Second, Item.Delete might return a Prompt object, which client
is supposed to call if keyring wants to confirm deletion.
This commit is contained in:
WGH 2021-03-21 20:44:02 +03:00 committed by Cole Robinson
parent 5b93a43622
commit d9b5090e06
1 changed files with 6 additions and 1 deletions

View File

@ -87,7 +87,12 @@ class vmmKeyring(vmmGObject):
iface = Gio.DBusProxy.new_sync(self._dbus, 0, None,
"org.freedesktop.secrets", path,
"org.freedesktop.Secret.Item", None)
iface.Delete("(s)", "/")
prompt = iface.Delete()
if prompt != "/":
iface = Gio.DBusProxy.new_sync(self._dbus, 0, None,
"org.freedesktop.secrets", prompt,
"org.freedesktop.Secret.Prompt", None)
iface.Prompt("(s)", "")
except Exception:
log.exception("Failed to delete keyring secret")