From 3d48af90d18acd9fdd0f8f296374f587d2d59eed Mon Sep 17 00:00:00 2001 From: =?utf8?q?Daniel=20Kou=C5=99il?= Date: Wed, 28 Mar 2007 12:38:54 +0000 Subject: [PATCH] An authenticated client name is taken as the job owner identity. We don't rely on information sent in the registration event anymore. --- org.glite.lb.server/src/store.c.T | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/org.glite.lb.server/src/store.c.T b/org.glite.lb.server/src/store.c.T index cdaa0e4..a8339c1 100644 --- a/org.glite.lb.server/src/store.c.T +++ b/org.glite.lb.server/src/store.c.T @@ -99,16 +99,24 @@ int edg_wll_StoreEvent(edg_wll_Context ctx,edg_wll_Event *e,int *seq) userid = strdup(strmd5(e->any.user,NULL)); -/* make sure user record is there */ - if ((err = store_user(ctx,userid,e->any.user))) goto clean; + if ((e->type == EDG_WLL_EVENT_REGJOB || lbproxy_notreg)) { + /* Register the job and owner. For LBproxy, contant "lbproxy" + is used as the name - it's harmless as the job is already + registered with LBserver */ + char *username; + + username = (ctx->isProxy) ? "lbproxy" : ctx->peerName; + userid = strdup(strmd5(username, NULL)); + if ((err = store_user(ctx,userid, username))) goto clean; + if ((err = store_job(ctx,e->any.jobId,userid))) goto clean; + } else { + /* for other events just make sure user record is there */ + userid = strdup(strmd5(e->any.user,NULL)); + if ((err = store_user(ctx,userid,e->any.user))) goto clean; + } jobid = edg_wlc_JobIdGetUnique(e->any.jobId); -/* only REGJOB events determine job owner now */ - if ( (e->type == EDG_WLL_EVENT_REGJOB || lbproxy_notreg) - && (err = store_job(ctx,e->any.jobId,userid))) goto clean; - - /* obtain next event sequence number */ trio_asprintf(&select_max, "select max(event) from events " -- 1.8.2.3