Merge 313_5 -> 313_6
authorZdeněk Šustr <sustr4@cesnet.cz>
Wed, 1 Apr 2009 13:53:12 +0000 (13:53 +0000)
committerZdeněk Šustr <sustr4@cesnet.cz>
Wed, 1 Apr 2009 13:53:12 +0000 (13:53 +0000)
17 files changed:
org.glite.lb.client/project/ChangeLog
org.glite.lb.common/project/ChangeLog
org.glite.lb.common/src/ulm_parse.c
org.glite.lb.logger/config/startup
org.glite.lb.logger/project/ChangeLog
org.glite.lb.server/Makefile
org.glite.lb.server/config/startup
org.glite.lb.server/examples/ws_status_history_test.sh [new file with mode: 0644]
org.glite.lb.server/interface/store.h
org.glite.lb.server/project/ChangeLog
org.glite.lb.server/src/jobstat.h
org.glite.lb.server/src/lb_authz.c
org.glite.lb.server/src/lb_xml_parse.c.T
org.glite.lb.server/src/ws_typeref.c.T
org.glite.lb.server/test/oneJob.qry
org.glite.lb.server/test/test_query_events.cpp
org.glite.lb.state-machine/src/process_event.c

index b66f2bb..86f7d68 100644 (file)
@@ -44,3 +44,6 @@
 4.0.0-3
 - configure script update (globus flavors added to configure call)
 
+from 3.2.2-1
+- Fix edg_wll_NotifDrop prototype (#34649).
+
index 7b3c51b..e739f15 100644 (file)
@@ -28,3 +28,6 @@
 7.0.0-4
 - configure script update (globus flavors added to configure call)
 
+from 6.1.3-1
+- Fixed parsing of strings containing '\' (bug #35770)
+
index 855c26b..a28e14f 100644 (file)
@@ -103,7 +103,7 @@ int edg_wll_ULMProcessParseTable(p_edg_wll_ULMFields this)
   char *func = "edg_wll_ULMProcessParseTable";
   char *eq;
   int  i,j;
-  int  eqCnt,qmCnt,spCnt;
+  int  eqCnt,qmCnt,spCnt,bsCnt;
   int  iArrayEQ[ULM_FIELDS_MAX];
   int  iArraySP[ULM_FIELDS_MAX];
   size_t size;
@@ -122,7 +122,7 @@ int edg_wll_ULMProcessParseTable(p_edg_wll_ULMFields this)
   }
 
   i = j = 0;
-  qmCnt = eqCnt = spCnt = 0;
+  qmCnt = eqCnt = spCnt = bsCnt = 0;
 
   size = strlen(this->raw);
 
@@ -132,45 +132,68 @@ int edg_wll_ULMProcessParseTable(p_edg_wll_ULMFields this)
     switch (this->raw[i]) {
       case ULM_SP :
       case ULM_TB :
-         if (qmCnt == 0) { iArraySP[spCnt] = i; spCnt++; }
+         if (qmCnt == 0) { 
+            iArraySP[spCnt] = i; spCnt++; 
+         } else { 
+            if (this->raw[i-1] == ULM_BS) bsCnt = 0; // escaped ULM_SP or ULM_TB inside value
+         }
          break;
       case ULM_EQ :
         if (i==0) {
-               fprintf(stderr,"%s: PARSE ERROR: '%c' at the beginning of log line.\n", func, ULM_EQ);
-               return ULM_PARSE_ERROR;
+            fprintf(stderr,"%s: PARSE ERROR: '%c' at the beginning of log line.\n", func, ULM_EQ);
+            return ULM_PARSE_ERROR;
         }
          if (qmCnt == 0) { 
-           if (isblank(this->raw[i-1]) || (!edg_wll_ULMisalphaext(this->raw[i-1]))) {
-             fprintf(stderr,"%s: PARSE ERROR: Disallowed character ('%c') or space before delimiter '%c'.\n",
-                     func,this->raw[i-1],ULM_EQ);
-             return ULM_PARSE_ERROR;
+            if (isblank(this->raw[i-1]) || (!edg_wll_ULMisalphaext(this->raw[i-1]))) {
+              fprintf(stderr,"%s: PARSE ERROR: Disallowed character ('%c') or space before delimiter '%c'.\n",
+                      func,this->raw[i-1],ULM_EQ);
+              return ULM_PARSE_ERROR;
            }
            if (isblank(this->raw[i+1]) || ((!edg_wll_ULMisalphaext(this->raw[i-1])) && (this->raw[i+1] != ULM_QM ))) {
-             fprintf(stderr,"%s: PARSE ERROR: Disallowed character ('%c') or space after delimiter '%c'.\n",
-                     func,this->raw[i+1],ULM_EQ);
-             return ULM_PARSE_ERROR;
+              fprintf(stderr,"%s: PARSE ERROR: Disallowed character ('%c') or space after delimiter '%c'.\n",
+                      func,this->raw[i+1],ULM_EQ);
+              return ULM_PARSE_ERROR;
            }
            iArrayEQ[eqCnt] = i; 
            eqCnt++; 
-         }
+         } else if (this->raw[i-1] == ULM_BS) bsCnt = 0; // escaped ULM_EQ inside value
          break;
       case ULM_LF :
-         if (qmCnt == 0) { this->raw[i] = '\0'; }
+         if (qmCnt == 0) { 
+            this->raw[i] = '\0'; 
+         } else if (this->raw[i-1] == ULM_BS) bsCnt = 0; // escaped ULM_LF inside value
         break;
+      case ULM_BS :
+         if (qmCnt != 0) { 
+            if (this->raw[i-1] == ULM_BS) {
+               if (bsCnt == 1) bsCnt = 0; // escaped ULM_BS inside value
+               else bsCnt = 1;
+            } else bsCnt = 1;
+         } else {
+            fprintf(stderr,"%s: PARSE ERROR: Disallowed character ('%c') at i=%d size=%lu char=%d bsCnt=%d qmCnt=%d.\n",
+                     func,this->raw[i],i+1,(unsigned long)size,this->raw[i],bsCnt,qmCnt);
+            for (j=0; j<=i; j++) fputc(this->raw[j],stderr);
+            fputc(ULM_LF,stderr);
+            return ULM_PARSE_ERROR;
+         }
+         break;
       case ULM_QM :
-         if (this->raw[i-1] != ULM_BS) {
-           if (qmCnt == 0) qmCnt++;
-           else qmCnt--;
-         }              
+         if (qmCnt == 0) {
+            qmCnt++;
+         } else {
+            if (bsCnt == 0) qmCnt--;
+            if (this->raw[i-1] == ULM_BS) bsCnt = 0; // escaped ULM_QM inside value
+         }
          if ((qmCnt == 0) && (!isspace(this->raw[i+1]) && (this->raw[i+1] != '\0'))) {
-             fprintf(stderr,"%s: PARSE ERROR: Disallowed character ('%c') after ending '%c'at i=%d size=%lu char=%d.\n",
-                     func,this->raw[i+1],ULM_QM,i,(unsigned long)size,this->raw[i+1]);
+             fprintf(stderr,"%s: PARSE ERROR: Disallowed character ('%c') after ending '%c' at i=%d size=%lu char=%d bsCnt=%d qmCnt=%d.\n",
+                     func,this->raw[i+1],ULM_QM,i+1,(unsigned long)size,this->raw[i+1],bsCnt,qmCnt);
              for (j=0; j<=i; j++) fputc(this->raw[j],stderr);
              fputc(ULM_LF,stderr);
              return ULM_PARSE_ERROR;
          }
          break;
       default :
+         if (this->raw[i-1] == ULM_BS) bsCnt = 0; // escaped character inside value
          break;
     } /* switch */
   } /* for */
@@ -186,7 +209,14 @@ int edg_wll_ULMProcessParseTable(p_edg_wll_ULMFields this)
   }
 
   if (qmCnt != 0) {
-    fprintf(stderr,"%s: PARSE ERROR: Last quoted value did not finish.\n",func);
+    fprintf(stderr,"%s: PARSE ERROR: Last quoted value did not finish (i=%d size=%lu char=%d bsCnt=%d qmCnt=%d).\n",
+                     func,i+1,(unsigned long)size,this->raw[i+1],bsCnt,qmCnt);
+    return ULM_PARSE_ERROR;                    
+  }
+
+  if (bsCnt != 0) {
+    fprintf(stderr,"%s: PARSE ERROR: Probably an unescaped '%c' occured (i=%d size=%lu char=%d bsCnt=%d qmCnt=%d).\n",
+                     func,ULM_BS,i+1,(unsigned long)size,this->raw[i+1],bsCnt,qmCnt);
     return ULM_PARSE_ERROR;                    
   }
 
index 2786cf4..814f9b8 100755 (executable)
@@ -1,4 +1,5 @@
 #!/bin/sh
+# chkconfig: 345 76 24
 
 GLITE_LOCATION=${GLITE_LOCATION:-/opt/glite}
 GLITE_LOCATION_VAR=${GLITE_LOCATION_VAR:-$GLITE_LOCATION/var}
index a8b0b7b..0353d29 100644 (file)
@@ -12,7 +12,7 @@
 1.4.9-1 (lb-1.7.3-1)
 - treat zero event expiration time as "never"
 
-1.4.9-2 (lb-1.74-1)
+1.4.9-2 (lb-1.7.4-1)
 - rebuild wrt. downgraded security 3.1.57-1
 
 1.4.9-3 (lb-1.8.0-1)
@@ -34,3 +34,6 @@
 2.0.0-4
 - configure script update (globus flavors added to configure call)
 
+from 1.4.11-1
+- Support chconfig in startup scripts (#27055)
+- Proper kill signal handling (#36470)
index 52ffc7c..53a4876 100644 (file)
@@ -64,7 +64,7 @@ SUFFIXES = .T
 DEBUG:=-g -O0 -Wall
 
 GRIDSITE_CFLAGS = -I${gridsite_prefix}/include `xml2-config --cflags`
-GRIDSITE_LIBS = -L${gridsite_prefix}/lib -lgridsite_globus `xml2-config --libs`
+GRIDSITE_LIBS = -L${gridsite_prefix}/${archlib} -lgridsite_globus `xml2-config --libs`
 
 LCAS_CFLAGS=-I${lcas_prefix}/include
 
index 9807cf8..9d90c31 100755 (executable)
@@ -1,4 +1,5 @@
 #!/bin/sh
+# chkconfig: 345 75 25
 
 GLITE_LOCATION=${GLITE_LOCATION:-/opt/glite}
 GLITE_LOCATION_VAR=${GLITE_LOCATION_VAR:-/var/glite}
diff --git a/org.glite.lb.server/examples/ws_status_history_test.sh b/org.glite.lb.server/examples/ws_status_history_test.sh
new file mode 100644 (file)
index 0000000..1e6f312
--- /dev/null
@@ -0,0 +1,85 @@
+#! /bin/bash
+
+#
+# bug #29165: Times in job status history downloaded from LB are schifted
+#
+# description: 
+#   Test compares returned history from:
+#    - official job status example (C API)
+#    - WS call (gsoap)
+#    - WS XML response message (gsoap)
+#
+# requirements:
+#   - stage area, default `pwd`
+#   - built WS LB server examples
+#   - gsoap-plugin in stage built with 'make DEBUG="-DDEBUG"'
+#   - running LB server, LB locallogger, and LB interlogger
+#   - proxy certificate for logging and querying
+#
+
+STAGE_LOCATION=${STAGE_LOCATION:-`pwd`}
+WS_EXAMPLES_LOCATION=${WS_EXAMPLES_LOCATION:-$STAGE_LOCATION/../org.glite.lb.server/build}
+LBSERVER=${LBSERVER:-`hostname -f`:9000}
+LBLOGGER=${LBLOGGER:-`hostname -f`:9002}
+
+script=$(EDG_WL_LOG_DESTINATION=$LBLOGGER $STAGE_LOCATION/examples/glite-lb-submitted.sh -m $LBSERVER 2>log | tail -n 1)
+eval $script
+test -z "$EDG_JOBID" && exit 2
+
+echo "jobid: $EDG_JOBID"
+EDG_WL_LOG_DESTINATION=$LBLOGGER $STAGE_LOCATION/examples/glite-lb-waiting.sh -j $EDG_JOBID 2>>log|| exit 3
+sleep 1
+EDG_WL_LOG_DESTINATION=$LBLOGGER $STAGE_LOCATION/examples/glite-lb-ready.sh -j $EDG_JOBID 2>>log|| exit 4
+sleep 1
+EDG_WL_LOG_DESTINATION=$LBLOGGER $STAGE_LOCATION/examples/glite-lb-done.sh -j $EDG_JOBID 2>>log|| exit 5
+sleep 1
+EDG_WL_LOG_DESTINATION=$LBLOGGER $STAGE_LOCATION/examples/glite-lb-cleared.sh -j $EDG_JOBID 2>>log|| exit 6
+sleep 1
+rm -f log
+
+# C API
+status="`TZ=C $STAGE_LOCATION/examples/glite-lb-job_status $EDG_JOBID`"
+if test x$(echo "$status" | grep '^state[ :]' | sed -e 's/^.*:[ ]*\(.*\)/\1/') != xCleared; then
+       echo "ERROR: Expected Cleared status of $EDG_JOBID"
+       exit 7
+fi
+echo "$status" | grep '^stateEnterTimes[ :]' -A 12 > hist-c.txt
+
+# WS call result
+rm -f RECV.log SENT.log TEST.log
+TZ=C $WS_EXAMPLES_LOCATION/ws_jobstat -j $EDG_JOBID | grep stateEnterTimes -A 12 > hist-ws.txt
+diff -u hist-c.txt hist-ws.txt
+ret1=$?
+if [ "$ret1" != "0" ]; then
+       echo "FAILED: WS and C API results differs"
+fi
+
+# WS XML message
+if [ ! -s "RECV.log" ]; then
+       echo "WARNING: RECV.log not found, WS/XML not compared"
+       exit $ret1
+fi
+echo "stateEnterTimes : " > hist-ws-recv.txt
+echo "     Undefined      - not available -" >> hist-ws-recv.txt
+grep '^[ \t]*<' RECV.log | xmllint --format - | grep -A3 '<stateEnterTimes>' | grep '<state>\|<time\>' | tr '\n' ' ' | sed -e 's/<\/time>/<\/time>\n/g' | while read statexml timexml; do
+       state=`echo $statexml | tr '\n' ' ' | sed -e 's/.*<state>\(.*\)<\/state>.*/\1/'`
+       time=`echo $timexml | tr '\n' ' ' | sed -e 's/.*<time>\(.*\)<\/time>.*/\1/'`
+       if [ x"$time" = x"1970-01-01T00:00:00Z" ]; then
+               timetxt="    - not available -"
+       else
+               timetxt=`TZ=C perl -e 'use POSIX; $ARGV[0] =~ /^(\d\d\d\d)-(\d\d)-(\d\d)T(\d\d):(\d\d):(\d\d)Z$/; print ctime(mktime($6, $5, $4, $3, $2 - 1, $1 - 1900, 0, 0, 0));' $time`
+       fi
+       printf "%14s  " $state; printf "$timetxt\n";
+done >> hist-ws-recv.txt
+diff -iu hist-c.txt hist-ws-recv.txt
+ret2=$?
+if [ "$ret2" != "0" ]; then
+       echo "FAILED: XML and C API results differs"
+fi
+
+if [ x"$ret1" = x"0" -a x"$ret2" = x"0" ]; then
+       echo "PASSED"
+       exit 0
+else
+       exit 1
+fi
index 3eb9789..f620b5d 100644 (file)
@@ -1,8 +1,8 @@
+#ident "$Header$"
+
 #ifndef GLITE_LB_STORE_H
 #define GLITE_LB_STORE_H
 
-#ident "$Header$"
-
 #include "jobstat.h"
 #include "lb_authz.h"
 
@@ -35,7 +35,6 @@ int register_subjobs_embryonic(edg_wll_Context,const edg_wll_RegJobEvent *);
 edg_wll_ErrorCode intJobStat_embryonic(edg_wll_Context ctx, glite_jobid_const_t jobid, const edg_wll_RegJobEvent *e, intJobStat *stat);
 
 
-
 int edg_wll_delete_event(edg_wll_Context,const char *, int);
 
 
index 4fff337..eb7e1bd 100644 (file)
 - fixed credential setting via gsoap-plugin (switching to a newly introduced API call)
 - minor initialization/freeing fixes
 - printout typo fix
+
+from 1.9.2-1
+- Support for chconfig in startup scripts (#27055)
+- Support for JP importer in startup scripts
+- Support for variant DN certificates (workaround for #41820)
+- Recalculate subjob states after DB version upgrade (#25871)
+- Ignore reseource_usage events when computing job states (#43767)
+- Fix sequence code processing for Change ACL events
+- Reflect job conditions while processing queries for events (#32390)
+- WS example fix
+
index 4862db0..8494a60 100644 (file)
@@ -1,8 +1,8 @@
+#ident "$Header$"
+
 #ifndef GLITE_LB_LBS_JOBSTAT_H
 #define GLITE_LB_LBS_JOBSTAT_H
 
-#ident "$Header$"
-
 #include "glite/lb/jobstat.h"
 #include "glite/lb/intjobstat.h"
 #include "glite/lbu/db.h"
index a0f9644..6bb2cbc 100644 (file)
@@ -928,7 +928,7 @@ int edg_wll_amIroot(const char *subj, char **fqans,char **super_users)
                        for (f = fqans; f && *f; f++)
                                if (strcmp(*f, super_users[i]+5) == 0) return 1;
                } else
-                       if (strcmp(subj,super_users[i]) == 0) return 1;
+                       if (edg_wll_gss_equal_subj(subj,super_users[i])) return 1;
 
        return 0;
 }
index 2be2079..ee8f4f9 100644 (file)
@@ -1395,7 +1395,7 @@ int parseNotifRequest(edg_wll_Context ctx, char *messageBody, char **function, e
                        free(XMLCtx.job_conditions);
                }
                free(XMLCtx.notifFunction);
-               edg_wll_NotifIdFree(&XMLCtx.notifId);
+               edg_wll_NotifIdFree(XMLCtx.notifId);
                free(XMLCtx.notifClientAddress);
 
                *function = NULL;
index c556d7a..7382d96 100644 (file)
@@ -264,8 +264,8 @@ void edg_wll_SoapToStatus(struct soap *soap,struct lbt__jobStatus const *src,edg
                        my %fmap = ( children_hist=>'count', stateEnterTimes=>'time');
                        gen qq {
 !      if (src->__size$usuc) {
-!              dest->$_ = calloc(EDG_WLL_NUMBER_OF_STATCODES+1, sizeof *dest->$_);
-!              dest->$_\[0] = src->__size$usuc;
+!              dest->$_ = calloc(src->__size$usuc + 1, sizeof *dest->$_);
+!              dest->$_\[0] = src->__size$usuc + 2;
 !              for (i=0; i<src->__size$usuc; i++) {
 !                      edg_wll_JobStatCode     s;
 !                      edg_wll_SoapToJobStatCode(GLITE_SECURITY_GSOAP_LIST_GET(src->$usuc, i)->state,&s);
index fd5e8bf..b46289d 100644 (file)
@@ -22,3 +22,11 @@ SEQCODE      UI=000002:NS=0000000001:WM=000000:BH=0000000000:JSS=000000:LM=000000:LRM
 SRC_INSTANCE   (nil)
 
 select name,value from long_fields where jobid = 'WrCEKje9QTXFiSOZuPMLtw' and event = 1
+
+SELECT DISTINCT j.dg_jobid,j.userid FROM jobs j WHERE (j.jobid='WrCEKje9QTXFiSOZuPMLtw')
+https://lhun.ics.muni.cz:4850/WrCEKje9QTXFiSOZuPMLtw   294de3557d9d00b3d2d8a1e6aab028cf
+
+SELECT e.event,j.userid,j.dg_jobid,e.code,e.prog,e.host,u.cert_subj,e.time_stamp,e.usec,e.level,e.arrived FROM events e,users u,jobs j WHERE j.dg_jobid = 'https://lhun.ics.muni.cz:4850/WrCEKje9QTXFiSOZuPMLtw' AND e.jobid=j.jobid AND e.userid=u.userid AND e.code != 0
+0      294de3557d9d00b3d2d8a1e6aab028cf        https://lhun.ics.muni.cz:4850/WrCEKje9QTXFiSOZuPMLtw    17      UserInterface   lhun.ics.muni.cz        anonymous       2003-08-07 11:08:40     432100  8       2003-08-07 11:08:40
+1      294de3557d9d00b3d2d8a1e6aab028cf        https://lhun.ics.muni.cz:4850/WrCEKje9QTXFiSOZuPMLtw    2       NetworkServer   lhun.ics.muni.cz        anonymous       2003-08-07 11:09:05     664600  8       2003-08-07 11:09:05
+
index fe80def..5224281 100644 (file)
@@ -164,6 +164,7 @@ int edg_wll_JobStatusServer(
        int             flags,
        edg_wll_JobStat *stat)
 {
+       edg_wlc_JobIdDup(job,&stat->jobId);
        return 0;
 }
 
index 80bd4ca..1dc77fe 100644 (file)
@@ -917,7 +917,7 @@ static int processEvent_glite(intJobStat *js, edg_wll_Event *e, int ev_seq, int
                case EDG_WLL_EVENT_CHKPT:
                        /* these three event are probably dead relics */
                case EDG_WLL_EVENT_RESOURCEUSAGE:
-                       /* ignore too - not used? */
+                       /* ignore, not reflected in job status */
                        break;
                case EDG_WLL_EVENT_CHANGEACL:
                        /* ignore, only for event log */