From: Daniel KouĊ™il Date: Thu, 21 Oct 2004 10:20:12 +0000 (+0000) Subject: Check also for negative values when verifying lifetime of creds X-Git-Tag: gridsite-core_R_1_0_4~91 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=54a4774c9227ac81592aa75eefa577a09cbf60b6;p=jra1mw.git Check also for negative values when verifying lifetime of creds --- 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;