From: Jiří Filipovič Date: Wed, 10 Jun 2009 14:07:52 +0000 (+0000) Subject: Strict jobid matching in edg_wll_UserJobsServer (matches full server address). X-Git-Tag: gridsite-core_R_1_7_1~11 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=8822f8b976041c03e4f12282545db236563028eb;p=jra1mw.git Strict jobid matching in edg_wll_UserJobsServer (matches full server address). --- diff --git a/org.glite.lb.server/src/userjobs.c b/org.glite.lb.server/src/userjobs.c index fe91812..5d62105 100644 --- a/org.glite.lb.server/src/userjobs.c +++ b/org.glite.lb.server/src/userjobs.c @@ -23,6 +23,8 @@ int edg_wll_UserJobsServer( char *userid, *stmt = NULL, *res = NULL; char *can_peername; + char *srv_name = NULL; + int name_len; int njobs = 0,ret,i,idx; edg_wlc_JobId *out = NULL; glite_lbu_Statement sth = NULL; @@ -63,14 +65,23 @@ int edg_wll_UserJobsServer( out = malloc(sizeof(*out)*(njobs+1)); memset(out,0,sizeof(*out)*(njobs+1)); + name_len = asprintf(&srv_name, "https://%s:%d/", + ctx->srvName, ctx->srvPort); + idx = 0; for (i=0; (ret = edg_wll_FetchRow(ctx,sth,1,NULL,&res)); i++) { if (ret < 0) goto err; - if ((ret = edg_wlc_JobIdParse(res,out+i))) { + if (strncmp(res, srv_name, name_len)){ + njobs--; + continue; + } + if ((ret = edg_wlc_JobIdParse(res,out+idx))) { edg_wll_SetError(ctx,errno,res); goto err; } + idx++; free(res); res = NULL; } + free(srv_name); if (states) { edg_wll_QueryRec oc[2],*ocp[2] = { oc, NULL };