use krb5_config_get_time

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@2997 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1997-08-15 07:02:30 +00:00
parent 2f8d66398e
commit 57e9268ff5

View File

@@ -44,7 +44,8 @@ krb5_error_code
krb5_init_context(krb5_context *context) krb5_init_context(krb5_context *context)
{ {
krb5_context p; krb5_context p;
const char *tmp; int val;
ALLOC(p, 1); ALLOC(p, 1);
if(!p) if(!p)
return ENOMEM; return ENOMEM;
@@ -53,19 +54,14 @@ krb5_init_context(krb5_context *context)
p->cc_ops = NULL; p->cc_ops = NULL;
krb5_config_parse_file (krb5_config_file, &p->cf); krb5_config_parse_file (krb5_config_file, &p->cf);
p->max_skew = 5 * 60; p->max_skew = 5 * 60;
tmp = krb5_config_get_string (p->cf, "libdefaults", "clockskew", NULL); val = krb5_config_get_time (p->cf, "libdefaults", "clockskew", NULL);
if(tmp){ if (val >= 0)
int val = parse_time(tmp, NULL); p->max_skew = val;
if(val >= 0)
p->max_skew = val;
}
p->kdc_timeout = 3; p->kdc_timeout = 3;
tmp = krb5_config_get_string (p->cf, "libdefaults", "kdc_timeout", NULL); val = krb5_config_get_time (p->cf, "libdefaults", "kdc_timeout", NULL);
if(tmp){ if(val >= 0)
int val = parse_time(tmp, NULL); p->kdc_timeout = val;
if(val >= 0)
p->kdc_timeout = val;
}
krb5_set_default_realm(p, NULL); krb5_set_default_realm(p, NULL);
*context = p; *context = p;
return 0; return 0;