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
This commit is contained in:
Johan Danielsson
1998-02-19 13:50:10 +00:00
parent 656a37d0fb
commit 12e2ed373d

View File

@@ -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? */