[krb5-auth-dialog] Check credential cache status when entering the mainloop



commit 1c3f34f7dd486e50ed8ba89baff13042ae2bed69
Author: Guido Günther <agx sigxcpu org>
Date:   Thu Feb 24 19:26:11 2011 +0100

    Check credential cache status when entering the mainloop
    
    Instead of waiting for the first time the expiry timer kicks in check
    for valid tickets once we've set up everything.

 src/ka-dialog.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/src/ka-dialog.c b/src/ka-dialog.c
index 1e2ef81..3114f49 100644
--- a/src/ka-dialog.c
+++ b/src/ka-dialog.c
@@ -502,6 +502,15 @@ credentials_expiring (gpointer *data)
 }
 
 
+/* run once, then terminate the timer */
+static gboolean
+credentials_expiring_once (gpointer *data)
+{
+    credentials_expiring(data);
+    return FALSE;
+}
+
+
 /*
  * set ticket options by looking at krb5.conf and gconf
  */
@@ -1096,6 +1105,7 @@ main (int argc, char *argv[])
 		ka_nm_init();
 
 		g_timeout_add_seconds (CREDENTIAL_CHECK_INTERVAL, (GSourceFunc)credentials_expiring, applet);
+		g_idle_add ((GSourceFunc)credentials_expiring_once, applet);
 		monitor = monitor_ccache (applet);
 
 		ka_dbus_service(applet);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]