From 91035a014f266357aa9b7a43acb7d456a5e9cabc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zden=C4=9Bk=20=C5=A0ustr?= Date: Wed, 1 Apr 2009 13:53:12 +0000 Subject: [PATCH] Merge 313_5 -> 313_6 --- org.glite.lb.client/project/ChangeLog | 3 + org.glite.lb.common/project/ChangeLog | 3 + org.glite.lb.common/src/ulm_parse.c | 72 ++++++++++++------ org.glite.lb.logger/config/startup | 1 + org.glite.lb.logger/project/ChangeLog | 5 +- org.glite.lb.server/Makefile | 2 +- org.glite.lb.server/config/startup | 1 + .../examples/ws_status_history_test.sh | 85 ++++++++++++++++++++++ org.glite.lb.server/interface/store.h | 5 +- org.glite.lb.server/project/ChangeLog | 12 ++- org.glite.lb.server/src/jobstat.h | 4 +- org.glite.lb.server/src/lb_authz.c | 2 +- org.glite.lb.server/src/lb_xml_parse.c.T | 2 +- org.glite.lb.server/src/ws_typeref.c.T | 4 +- org.glite.lb.server/test/oneJob.qry | 8 ++ org.glite.lb.server/test/test_query_events.cpp | 1 + org.glite.lb.state-machine/src/process_event.c | 2 +- 17 files changed, 178 insertions(+), 34 deletions(-) create mode 100644 org.glite.lb.server/examples/ws_status_history_test.sh diff --git a/org.glite.lb.client/project/ChangeLog b/org.glite.lb.client/project/ChangeLog index b66f2bb..86f7d68 100644 --- a/org.glite.lb.client/project/ChangeLog +++ b/org.glite.lb.client/project/ChangeLog @@ -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). + diff --git a/org.glite.lb.common/project/ChangeLog b/org.glite.lb.common/project/ChangeLog index 7b3c51b..e739f15 100644 --- a/org.glite.lb.common/project/ChangeLog +++ b/org.glite.lb.common/project/ChangeLog @@ -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) + diff --git a/org.glite.lb.common/src/ulm_parse.c b/org.glite.lb.common/src/ulm_parse.c index 855c26b..a28e14f 100644 --- a/org.glite.lb.common/src/ulm_parse.c +++ b/org.glite.lb.common/src/ulm_parse.c @@ -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; } diff --git a/org.glite.lb.logger/config/startup b/org.glite.lb.logger/config/startup index 2786cf4..814f9b8 100755 --- a/org.glite.lb.logger/config/startup +++ b/org.glite.lb.logger/config/startup @@ -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} diff --git a/org.glite.lb.logger/project/ChangeLog b/org.glite.lb.logger/project/ChangeLog index a8b0b7b..0353d29 100644 --- a/org.glite.lb.logger/project/ChangeLog +++ b/org.glite.lb.logger/project/ChangeLog @@ -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) diff --git a/org.glite.lb.server/Makefile b/org.glite.lb.server/Makefile index 52ffc7c..53a4876 100644 --- a/org.glite.lb.server/Makefile +++ b/org.glite.lb.server/Makefile @@ -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 diff --git a/org.glite.lb.server/config/startup b/org.glite.lb.server/config/startup index 9807cf8..9d90c31 100755 --- a/org.glite.lb.server/config/startup +++ b/org.glite.lb.server/config/startup @@ -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 index 0000000..1e6f312 --- /dev/null +++ b/org.glite.lb.server/examples/ws_status_history_test.sh @@ -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 '' | grep '\|' | tr '\n' ' ' | sed -e 's/<\/time>/<\/time>\n/g' | while read statexml timexml; do + state=`echo $statexml | tr '\n' ' ' | sed -e 's/.*\(.*\)<\/state>.*/\1/'` + time=`echo $timexml | tr '\n' ' ' | sed -e 's/.*