krb5: Introduce KRB5_TKT_LIFETIME_DEFAULT

Instead of hard coding 10 hours as the default ticket lifetime within
lib/krb5/init_cred_pw.c init_cred(), add a preprocessor macro,
KRB5_TKT_LIFETIME_DEFAULT, that can be overridden at build time.

The value of KRB5_TKT_LIFETIME_DEFAULT is 10 hours if not previously
defined.

Change-Id: I63e729fedee8e8c6f542e4a4665de5f40db34c03
This commit is contained in:
Jeffrey Altman
2015-04-16 20:34:35 -04:00
parent d6a7d14fc5
commit e8e9cd9710
2 changed files with 5 additions and 1 deletions

View File

@@ -246,7 +246,7 @@ init_cred (krb5_context context,
if (options->flags & KRB5_GET_INIT_CREDS_OPT_TKT_LIFE)
tmp = options->tkt_life;
else
tmp = 10 * 60 * 60;
tmp = KRB5_TKT_LIFETIME_DEFAULT;
cred->times.endtime = now + tmp;
if ((options->flags & KRB5_GET_INIT_CREDS_OPT_RENEW_LIFE) &&

View File

@@ -356,6 +356,10 @@ typedef struct krb5_context_data {
#define KRB5_FALLBACK_DEFAULT TRUE
#endif
#ifndef KRB5_TKT_LIFETIME_DEFAULT
# define KRB5_TKT_LIFETIME_DEFAULT (10 * 60 * 60) /* 10 hours */
#endif
#ifdef PKINIT
struct krb5_pk_identity {