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 680892 - user-panel: Update to new DBus interface for realmd 0.6
user-panel: Update to new DBus interface for realmd 0.6
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: User Accounts
unspecified
Other All
: Normal normal
: ---
Assigned To: Control-Center Maintainers
Control-Center Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-07-31 09:45 UTC by Stef Walter
Modified: 2012-08-08 12:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
user-panel: Update to new DBus interface for realmd 0.6 (24.55 KB, patch)
2012-07-31 09:45 UTC, Stef Walter
committed Details | Review
user-accounts: Cleanup GVariant usage (2.95 KB, patch)
2012-08-08 07:32 UTC, Stef Walter
committed Details | Review
user-accounts: Remove needless console output (1.01 KB, patch)
2012-08-08 07:34 UTC, Stef Walter
committed Details | Review

Description Stef Walter 2012-07-31 09:45:53 UTC
Update to new realmd interfaces. I'll be doing this release soon:

https://bugs.freedesktop.org/show_bug.cgi?id=52993

But this code works with git master of realmd as well since I've bumped
the version number.
Comment 1 Stef Walter 2012-07-31 09:45:56 UTC
Created attachment 219957 [details] [review]
user-panel: Update to new DBus interface for realmd 0.6

 * In particular support of different credential methods and better
   hints for different owners of those credentials, so we can prompt
   more cleanly.
 * Less abstraction in the realmd interfaces
Comment 2 Ray Strode [halfline] 2012-08-06 17:02:54 UTC
Review of attachment 219957 [details] [review]:

Looks fine.  We should definitely work with the latest realmd.  A few comments below, but I don't think any of them are critical, so commit whenever.

::: panels/user-accounts/data/org.freedesktop.realmd.xml
@@ +107,3 @@
+		 * Credentials: (ssv)
+		 *  type: 'ccache', 'password', 'automatic'
+		 *  owner: 'administrator', 'user', 'computer', 'secret'

in the realmd source this says who not owner

::: panels/user-accounts/um-account-dialog.c
@@ +429,3 @@
+        um_realm_kerberos_call_change_login_policy (self->selected_realm, "",
+                                                    add, remove,
+                                                    g_variant_ref_sink (options),

I don't think you need to ref_sink here

@@ +434,3 @@
+                                                    g_object_ref (self));
+
+        g_variant_unref (options);

or unref here.  The floating reference should just work without any ref/unref.  Could be I'm wrong though. You do this refsink thing in most calls

::: panels/user-accounts/um-realm-manager.c
@@ +623,1 @@
+        creds = g_variant_new ("(ss@v)", type, owner, g_variant_new_variant (contents));

It could be i'm missing something, but can't you just do

g_variant_new ("(ssv)", type, owner, contents);

?
Comment 3 Stef Walter 2012-08-06 17:16:37 UTC
(In reply to comment #2)
> Review of attachment 219957 [details] [review]:
> 
> Looks fine.  We should definitely work with the latest realmd.  A few comments
> below, but I don't think any of them are critical, so commit whenever.

Alright, I pushed the patch as is. But will follow it up with another commit to tweak the stylish issues below. I didn't have time to make the changes below *and* test against a directory. I mean, it's pretty clear you're right on these things, I just feel uneasy making changes without running them especially when it comes to spooky things like floating references.

> ::: panels/user-accounts/data/org.freedesktop.realmd.xml
> @@ +107,3 @@
> +         * Credentials: (ssv)
> +         *  type: 'ccache', 'password', 'automatic'
> +         *  owner: 'administrator', 'user', 'computer', 'secret'
> 
> in the realmd source this says who not owner

Will change this in realmd.

> ::: panels/user-accounts/um-account-dialog.c
> @@ +429,3 @@
> +        um_realm_kerberos_call_change_login_policy (self->selected_realm, "",
> +                                                    add, remove,
> +                                                    g_variant_ref_sink
> (options),
> 
> I don't think you need to ref_sink here
> 
> @@ +434,3 @@
> +                                                    g_object_ref (self));
> +
> +        g_variant_unref (options);
> 
> or unref here.  The floating reference should just work without any ref/unref. 
> Could be I'm wrong though. You do this refsink thing in most calls

Indeed. Since the the various um_realm-kerberos_call_ wrappers pass all the arguments to g_variant_new() ... Will change.

> ::: panels/user-accounts/um-realm-manager.c
> @@ +623,1 @@
> +        creds = g_variant_new ("(ss@v)", type, owner, g_variant_new_variant
> (contents));
> 
> It could be i'm missing something, but can't you just do
> 
> g_variant_new ("(ssv)", type, owner, contents);

You're right. Will change.
Comment 4 Stef Walter 2012-08-08 07:32:50 UTC
Created attachment 220641 [details] [review]
user-accounts: Cleanup GVariant usage

 * Don't call g_variant_ref_sink() unnecessarily.
 * Don't call g_variant_new_variant() unnecessarily.
Comment 5 Stef Walter 2012-08-08 07:34:08 UTC
Created attachment 220642 [details] [review]
user-accounts: Remove needless console output
Comment 6 Bastien Nocera 2012-08-08 09:24:42 UTC
Review of attachment 220641 [details] [review]:

Looks good.
Comment 7 Bastien Nocera 2012-08-08 09:25:32 UTC
Review of attachment 220642 [details] [review]:

Feel free to add any g_debug() calls you think might be needed to debug in the future.
Comment 8 Stef Walter 2012-08-08 12:25:50 UTC
Attachment 220641 [details] pushed as 4e67ecc - user-accounts: Cleanup GVariant usage
Attachment 220642 [details] pushed as ec2fc6d - user-accounts: Remove needless console output