diff options
author | nalin <nalin@517b70f8-ed25-0410-8bf6-f5db08f7b76e> | 2005-11-02 23:49:40 +0000 |
---|---|---|
committer | nalin <nalin@517b70f8-ed25-0410-8bf6-f5db08f7b76e> | 2005-11-02 23:49:40 +0000 |
commit | 94395bb3a7309d23bf5f50bf8161d1e2f1a755cc (patch) | |
tree | 5d61bc01a0571bdbb5878ccf2f4f349d87c8e542 /src | |
parent | 2dcf8c43c774c814fbaedee34f0633db6c53ab10 (diff) |
* configure.ac,src/krb5-auth-dialog.c: make the minimum acceptable lifetime
for new credentials the minimum that would force us to take action,
not the amount of time we wait in between checks. Let the check
interval be defined in seconds and the minimum lifetime be specified
in minutes.
git-svn-id: http://svn.gnome.org/svn/krb5-auth-dialog/trunk@44 517b70f8-ed25-0410-8bf6-f5db08f7b76e
Diffstat (limited to 'src')
-rw-r--r-- | src/krb5-auth-dialog.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/krb5-auth-dialog.c b/src/krb5-auth-dialog.c index 1b1b6f6..170774a 100644 --- a/src/krb5-auth-dialog.c +++ b/src/krb5-auth-dialog.c @@ -33,9 +33,6 @@ #include <libnm_glib.h> #endif -#define CREDENTIAL_CHECK_INTERVAL 30000 /* milliseconds */ -#define SECONDS_BEFORE_PROMPTING 1800 - static GladeXML *xml = NULL; static krb5_context kcontext; static krb5_principal kprincipal; @@ -254,7 +251,7 @@ credentials_expiring_real (void) krb5_copy_principal(kcontext, my_creds.client, &kprincipal); } creds_expiry = my_creds.times.endtime; - if (time(NULL) + SECONDS_BEFORE_PROMPTING > my_creds.times.endtime) + if (time(NULL) + MINUTES_BEFORE_PROMPTING * 60 > my_creds.times.endtime) retval = TRUE; krb5_free_cred_contents(kcontext, &my_creds); @@ -351,7 +348,7 @@ set_options_using_creds(krb5_context context, renew_lifetime); } if (creds->times.endtime > - creds->times.starttime + CREDENTIAL_CHECK_INTERVAL) { + creds->times.starttime + MINUTES_BEFORE_PROMPTING * 60) { krb5_get_init_creds_opt_set_tkt_life(opts, creds->times.endtime - creds->times.starttime); @@ -569,7 +566,7 @@ main (int argc, char *argv[]) dialog = glade_xml_get_widget (xml, "krb5_dialog"); if (credentials_expiring (NULL)) - g_timeout_add (CREDENTIAL_CHECK_INTERVAL, (GSourceFunc)credentials_expiring, NULL); + g_timeout_add (CREDENTIAL_CHECK_INTERVAL * 1000, (GSourceFunc)credentials_expiring, NULL); gtk_main (); } |