aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornalin <nalin@517b70f8-ed25-0410-8bf6-f5db08f7b76e>2005-11-02 23:49:40 +0000
committernalin <nalin@517b70f8-ed25-0410-8bf6-f5db08f7b76e>2005-11-02 23:49:40 +0000
commit94395bb3a7309d23bf5f50bf8161d1e2f1a755cc (patch)
tree5d61bc01a0571bdbb5878ccf2f4f349d87c8e542
parent2dcf8c43c774c814fbaedee34f0633db6c53ab10 (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
-rw-r--r--ChangeLog8
-rw-r--r--configure.ac14
-rw-r--r--src/krb5-auth-dialog.c9
3 files changed, 25 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 341e019..9a91572 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
2005-11-02 Nalin Dahyabhai <nalin@redhat.com>
+ * 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.
+
+2005-11-02 Nalin Dahyabhai <nalin@redhat.com>
+
* configure.ac,src/krb5-auth-dialog.c: just test for the definitions
of the flags directly.
diff --git a/configure.ac b/configure.ac
index 242aa6c..46c90a6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -95,12 +95,26 @@ fi
AM_CONDITIONAL([ENABLE_NETWORK_MANAGER],[test "x$enable_network_manager" = "xyes"])
+check_interval=30
+AC_DEFINE_UNQUOTED(CREDENTIAL_CHECK_INTERVAL,[$check_interval],
+ [Define the to number of seconds to wait between checks of
+ the Kerberos credential cache.])
+AC_SUBST(check_interval)
+
+minimum_lifetime=30
+AC_DEFINE_UNQUOTED(MINUTES_BEFORE_PROMPTING,[$minimum_lifetime],
+ [Define the to the minimum amount of time (m) a credential
+ will have to be valid before we'll ask the user to get
+ fresh credentials.])
+AC_SUBST(minimum_lifetime)
+
CFLAGS="$GNOME_CFLAGS $KRB5_CFLAGS $NETWORK_MANAGER_CFLAGS $CFLAGS"
AC_OUTPUT([
Makefile
krb5-auth-dialog.spec
src/Makefile
+src/krb5-auth-dialog.1
etpo/Makefile
po/Makefile.in
])
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 ();
}