[PATCH 1/3] Fix forgetting password from keyring

Cole Robinson crobinso at redhat.com
Tue Apr 6 23:41:31 UTC 2021


On 3/21/21 1:44 PM, wgh at torlan.ru wrote:
> From: WGH <wgh at torlan.ru>
> 
> 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.
> ---
>  virtManager/lib/keyring.py | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/virtManager/lib/keyring.py b/virtManager/lib/keyring.py
> index 203886dc..c0f50142 100644
> --- a/virtManager/lib/keyring.py
> +++ b/virtManager/lib/keyring.py
> @@ -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")
>  
> 

Thanks! I pushed this series

- Cole




More information about the virt-tools-list mailing list