summaryrefslogtreecommitdiffstats
path: root/src/krb524/conv_creds.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/krb524/conv_creds.c')
-rw-r--r--src/krb524/conv_creds.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/krb524/conv_creds.c b/src/krb524/conv_creds.c
index 5ab295f2b..5346f883d 100644
--- a/src/krb524/conv_creds.c
+++ b/src/krb524/conv_creds.c
@@ -99,6 +99,7 @@ int krb524_convert_creds_plain(context, v5creds, v4creds)
{
unsigned long addr;
int ret;
+ krb5_timestamp lifetime;
memset((char *) v4creds, 0, sizeof(CREDENTIALS));
@@ -122,8 +123,10 @@ int krb524_convert_creds_plain(context, v5creds, v4creds)
/* V4 has no concept of authtime or renew_till, so ignore them */
/* V4 lifetime is 1 byte, in 5 minute increments */
- v4creds->lifetime = 0xff &
+ lifetime =
((v5creds->times.endtime - v5creds->times.starttime) / 300);
+ v4creds->lifetime =
+ ((lifetime > 0xff) ? 0xff : lifetime);
v4creds->issue_date = v5creds->times.starttime;
/* XXX perhaps we should use the addr of the client host if */