An authenticated client name is taken as the job owner identity. We don't rely
authorDaniel Kouřil <kouril@ics.muni.cz>
Wed, 28 Mar 2007 12:38:54 +0000 (12:38 +0000)
committerDaniel Kouřil <kouril@ics.muni.cz>
Wed, 28 Mar 2007 12:38:54 +0000 (12:38 +0000)
on information sent in the registration event anymore.

org.glite.lb.server/src/store.c.T

index cdaa0e4..a8339c1 100644 (file)
@@ -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 "