From 12e2ed373d6d4eb5d91a8baf5a2f346de698004b Mon Sep 17 00:00:00 2001 From: Johan Danielsson Date: Thu, 19 Feb 1998 13:50:10 +0000 Subject: [PATCH] Don't store expired tokens (this broke when using pag-less rsh-sessions, and `non-standard' ticket files). git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@4438 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/kafs/common.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/kafs/common.c b/lib/kafs/common.c index 0b6d22987..048269965 100644 --- a/lib/kafs/common.c +++ b/lib/kafs/common.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997 Kungliga Tekniska Högskolan + * Copyright (c) 1997, 1998 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -78,6 +78,9 @@ kafs_settoken(const char *cell, uid_t uid, CREDENTIALS *c) ct.ViceId = uid; /* is this always valid? */ ct.BeginTimestamp = 1 + c->issue_date; ct.EndTimestamp = krb_life_to_time(c->issue_date, c->lifetime); + if(ct.EndTimestamp < time(NULL)) + return 0; /* don't store tokens that has expired (and possibly + overwriting valid tokens)*/ #define ODD(x) ((x) & 1) /* If we don't know the numerical ID lifetime should be even? */