From 54a4774c9227ac81592aa75eefa577a09cbf60b6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Daniel=20Kou=C5=99il?= Date: Thu, 21 Oct 2004 10:20:12 +0000 Subject: [PATCH] Check also for negative values when verifying lifetime of creds --- org.glite.lb.common/src/lb_gss.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/org.glite.lb.common/src/lb_gss.c b/org.glite.lb.common/src/lb_gss.c index a5642cb..a9de75f 100644 --- a/org.glite.lb.common/src/lb_gss.c +++ b/org.glite.lb.common/src/lb_gss.c @@ -521,7 +521,9 @@ edg_wll_gss_acquire_cred_gsi(char *cert_file, char *key_file, gss_cred_id_t *cre goto end; } - if (lifetime == 0) { + /* Must cast to time_t since OM_uint32 is unsinged and hence we couldn't + * detect negative values. */ + if ((time_t) lifetime <= 0) { major_status = GSS_S_CREDENTIALS_EXPIRED; minor_status = 0; /* XXX */ ret = EDG_WLL_GSS_ERROR_GSS; -- 1.8.2.3