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 709103 - Shows 2 Kerberos entries for one kinit
Shows 2 Kerberos entries for one kinit
Status: RESOLVED FIXED
Product: gnome-online-accounts
Classification: Core
Component: Kerberos
3.10.x
Other Linux
: Normal normal
: ---
Assigned To: GNOME Online Accounts maintainer(s)
GNOME Online Accounts maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2013-09-30 14:58 UTC by Debarshi Ray
Modified: 2013-10-01 15:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
identity: Fix occasional warning spew (2.65 KB, patch)
2013-09-30 18:15 UTC, Ray Strode [halfline]
committed Details | Review
identity: user g_hash_table_unref not g_clear_object (2.25 KB, patch)
2013-09-30 18:15 UTC, Ray Strode [halfline]
committed Details | Review
identity: don't queue two temporary accounts for one identity (9.95 KB, patch)
2013-09-30 18:15 UTC, Ray Strode [halfline]
committed Details | Review

Description Debarshi Ray 2013-09-30 14:58:01 UTC
If I grab a ticket using kinit, then both accounts.conf and the UI shows two Kerberos accounts when there should only be one.

This wasn't the case before the latest round of Kerberos changes. I tested using a new Fedora 19 VM without any updates.
Comment 1 Ray Strode [halfline] 2013-09-30 18:15:22 UTC
okay i'll attach a patch that fixes this and two patches for other problems i noticed along the way.
Comment 2 Ray Strode [halfline] 2013-09-30 18:15:47 UTC
Created attachment 256127 [details] [review]
identity: Fix occasional warning spew

It's possible to unschedule a timer when the timer is already dispatched,
but not yet holding the lock. If this happens, a precondition check
for the timer type may fail, leading to warning on the console.

This commit moves that precondition check to within the lock, and
also adds an explicit check to see if the timer has been unscheduled,
shortly after dispatch.
Comment 3 Ray Strode [halfline] 2013-09-30 18:15:50 UTC
Created attachment 256128 [details] [review]
identity: user g_hash_table_unref not g_clear_object

the identity service finalize function is using
g_clear_object on hash tables, which is incorrect.

This commit changes the g_clear_object calls to use
g_clear_pointer and g_hash_table_unref instead.
Comment 4 Ray Strode [halfline] 2013-09-30 18:15:52 UTC
Created attachment 256129 [details] [review]
identity: don't queue two temporary accounts for one identity

There are cases where more than one temporary g-o-a account can get
created on kinit. That is because creating a temporary account is
asynchronous, and kinit can trigger multiple refreshes of the credential
cache in one go.

This commit accounts for all pending temporary account additions in a
hash table, and filters out duplicates.
Comment 5 Debarshi Ray 2013-10-01 15:32:29 UTC
Review of attachment 256127 [details] [review]:

Looks good to me.
Comment 6 Debarshi Ray 2013-10-01 15:35:37 UTC
Review of attachment 256128 [details] [review]:

Looks good to me.

::: src/goaidentity/goaidentityservice.c
@@ +698,3 @@
+                   (GDestroyNotify) g_hash_table_unref);
+  g_clear_pointer (&self->priv->key_holders,
+                   (GDestroyNotify) g_hash_table_unref);

Since this is finalize you could have only used g_hash_table_unref, but, I guess, this is better if we ever want to move it to dispose.
Comment 7 Debarshi Ray 2013-10-01 15:42:34 UTC
Review of attachment 256129 [details] [review]:

Looks good to me.

::: src/goaidentity/goaidentityservice.c
@@ +683,3 @@
+                                                                         g_free,
+                                                                         (GDestroyNotify)
+                                                                         g_object_unref);

The GDestroyNotify type casts are not needed because g_free and g_object_unref both satisfy the type. Not a big deal. We can remove them later.
Comment 8 Ray Strode [halfline] 2013-10-01 15:46:30 UTC
Comment on attachment 256127 [details] [review]
identity: Fix occasional warning spew

Attachment 256127 [details] pushed as 1a06c9c - identity: Fix occasional warning spew
Comment 9 Ray Strode [halfline] 2013-10-01 15:54:01 UTC
Attachment 256129 [details] pushed as 3341979 - identity: don't queue two temporary accounts for one identity