From dfaeb5c3ea17aa8960ff1e938fe0d9b735f19aa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Groenvall?= Date: Mon, 26 May 1997 17:38:24 +0000 Subject: [PATCH] According to hearsay the token lifetime should be even if we don't know the proper ViceId. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1780 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/kafs/afskrb.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/kafs/afskrb.c b/lib/kafs/afskrb.c index 60f4ff438..3dffef9ed 100644 --- a/lib/kafs/afskrb.c +++ b/lib/kafs/afskrb.c @@ -318,6 +318,11 @@ k_afsklog_uid(const char *cell, const char *krealm, uid_t uid) ct.BeginTimestamp = 1 + c.issue_date; ct.EndTimestamp = krb_life_to_time(c.issue_date, c.lifetime); +#define ODD(x) ((x) & 1) + /* If we don't know the numerical ID lifetime should be even? */ + if (uid == 0 && ODD(ct.EndTimestamp - ct.BeginTimestamp)) + ct.BeginTimestamp--; + t = buf; /* * length of secret token followed by secret token