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:
@@ -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).
|
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||||
* All rights reserved.
|
* 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.ViceId = uid; /* is this always valid? */
|
||||||
ct.BeginTimestamp = 1 + c->issue_date;
|
ct.BeginTimestamp = 1 + c->issue_date;
|
||||||
ct.EndTimestamp = krb_life_to_time(c->issue_date, c->lifetime);
|
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)
|
#define ODD(x) ((x) & 1)
|
||||||
/* If we don't know the numerical ID lifetime should be even? */
|
/* If we don't know the numerical ID lifetime should be even? */
|
||||||
|
Reference in New Issue
Block a user