After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 753355 - Store credentials using secrets service
Store credentials using secrets service
Status: RESOLVED FIXED
Product: vinagre
Classification: Applications
Component: RDP
unspecified
Other Linux
: Normal normal
: ---
Assigned To: vinagre-maint
vinagre-maint
Depends on:
Blocks:
 
 
Reported: 2015-08-07 14:04 UTC by Marek Kašík
Modified: 2015-11-23 11:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Store credentials for RDP (33.92 KB, patch)
2015-08-07 14:04 UTC, Marek Kašík
none Details | Review
Handle domain when looking for credentials (17.58 KB, patch)
2015-09-15 14:40 UTC, Marek Kašík
none Details | Review
Store credentials for RDP (16.68 KB, patch)
2015-09-15 14:41 UTC, Marek Kašík
committed Details | Review
Handle domain when looking for credentials (19.71 KB, patch)
2015-11-20 16:51 UTC, Marek Kašík
committed Details | Review

Description Marek Kašík 2015-08-07 14:04:29 UTC
Created attachment 308900 [details] [review]
Store credentials for RDP

Attached patch adds support for storing of credentials using secrets service to RDP plugin.
The patch handles unsuccessful authentications by asking user for credentials. It also adds optional "domain" attribute to credentials handling and adds ability to show default values for 'username' and 'domain' in authentication dialog.
Comment 1 David King 2015-08-24 10:40:56 UTC
Review of attachment 308900 [details] [review]:

Looks good, but can you split the domain changes into a separate patch? Thanks!
Comment 2 Marek Kašík 2015-09-15 14:40:29 UTC
Created attachment 311379 [details] [review]
Handle domain when looking for credentials

Here is the first part which adds the domain property and its usage in the base code.
Comment 3 Marek Kašík 2015-09-15 14:41:28 UTC
Created attachment 311380 [details] [review]
Store credentials for RDP

This is the second part which enables the credentials storage for RDP plugin.
Comment 4 David King 2015-09-17 09:25:18 UTC
Review of attachment 311379 [details] [review]:

Generally looks fine. Does this work fine with existing passwords, which will not have the domain attribute?

::: vinagre/vinagre-tab.c
@@ +754,3 @@
+    *domain = NULL;
+
+  /* "domain" goes last, to terminate the attribute list if conn_domain is NULL. */

This (probably) breaks storing of passwords where the username is NULL, as well as the domain. See commit 7b301aee94c6c6e62ef5afc0c3be88735f03ba0e for the full reasoning. If both domain and username can be NULL, you need to take care that the parameter list passed to secret_passwork_lookup_sync() is terminated with a NULL.

@@ +821,3 @@
   if (tab->priv->saved_credentials)
     {
+      /* Put "domain" last, to terminate the attributes if conn_domain is NULL. */

Same comment as above.
Comment 5 David King 2015-09-17 09:32:33 UTC
Review of attachment 311380 [details] [review]:

Looks fine, although this will have to wait until the freeze is over, and the domain patch has been merged.
Comment 6 Marek Kašík 2015-09-24 14:02:13 UTC
(In reply to David King from comment #4)
> Review of attachment 311379 [details] [review] [review]:
> 
> Generally looks fine. Does this work fine with existing passwords, which
> will not have the domain attribute?

Yes, it works for me when no domain is specified.


> ::: vinagre/vinagre-tab.c
> @@ +754,3 @@
> +    *domain = NULL;
> +
> +  /* "domain" goes last, to terminate the attribute list if conn_domain is
> NULL. */
> 
> This (probably) breaks storing of passwords where the username is NULL, as
> well as the domain. See commit 7b301aee94c6c6e62ef5afc0c3be88735f03ba0e for
> the full reasoning. If both domain and username can be NULL, you need to
> take care that the parameter list passed to secret_passwork_lookup_sync() is
> terminated with a NULL.

I actually see a problem when username is NULL and domain is not NULL only. I didn't suppose that it could happen but I can modify the code so that it wouldn't cause troubles.
If username and domain are NULL, then the list of parameters passed to the secret_passwork_lookup_sync() would end with 5 NULLs which I thought is OK.


> @@ +821,3 @@
>    if (tab->priv->saved_credentials)
>      {
> +      /* Put "domain" last, to terminate the attributes if conn_domain is
> NULL. */
> 
> Same comment as above.
Comment 7 Marek Kašík 2015-11-20 16:51:05 UTC
Created attachment 315982 [details] [review]
Handle domain when looking for credentials

I've rewritten the calls of secret functions to use GHashTable for passed attributes. This way we don't need to handle the terminal NULLs.
Comment 8 David King 2015-11-21 08:43:33 UTC
Review of attachment 315982 [details] [review]:

Looks fine to me.
Comment 9 Marek Kašík 2015-11-23 11:18:14 UTC
Comment on attachment 311380 [details] [review]
Store credentials for RDP

Thank you for the reviews. I've pushed both patches to master.