From 0fadad24c07a7019d4f91c5b605325f0a7849b7d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= Date: Wed, 30 May 2007 08:04:48 +0000 Subject: [PATCH] Quick update (internal structures of gsoap-plugin needed), SQL escaping of ' ==> used it instead of " Small old patch for test scripts. --- org.glite.jp.index/examples/jpis-test.c | 1 + org.glite.jp.index/examples/query-tests/run-test.sh | 3 ++- org.glite.jp.index/src/bones_server.c | 1 + org.glite.jp.index/src/soap_ops.c | 4 ++-- org.glite.jp.index/src/soap_ps_calls.c | 1 + 5 files changed, 7 insertions(+), 3 deletions(-) diff --git a/org.glite.jp.index/examples/jpis-test.c b/org.glite.jp.index/examples/jpis-test.c index f450182..02ac20e 100644 --- a/org.glite.jp.index/examples/jpis-test.c +++ b/org.glite.jp.index/examples/jpis-test.c @@ -4,6 +4,7 @@ #include #include +#include #include "glite/jp/strmd5.h" #include "jp_H.h" diff --git a/org.glite.jp.index/examples/query-tests/run-test.sh b/org.glite.jp.index/examples/query-tests/run-test.sh index 32388a0..0ee2d68 100755 --- a/org.glite.jp.index/examples/query-tests/run-test.sh +++ b/org.glite.jp.index/examples/query-tests/run-test.sh @@ -121,6 +121,7 @@ run_is() { echo -n "I" # run index server + #valgrind --tool=memcheck --trace-children=yes --num-callers=15 --suppressions=$HOME/egee.supp X509_USER_KEY=${X509_USER_KEY} X509_USER_CERT=${X509_USER_CERT} \ $GLITE_LOCATION/bin/glite-jp-indexd -m $GLITE_JPIS_TEST_DB -p $GLITE_JPIS_TEST_PORT \ -i ${GLITE_JPIS_TEST_PIDFILE} -o ${GLITE_JPIS_TEST_LOGFILE} \ @@ -148,7 +149,7 @@ run_is() { ret=1 i=0 while [ x"$ret" != x"0" -a $i -lt 20 ]; do - netstat -tap 2>/dev/null | grep "\<$GLITE_JPIS_TEST_PORT\>" > /dev/null + netstat -tapn 2>/dev/null | grep "\<$GLITE_JPIS_TEST_PORT\>" > /dev/null ret=$? i=$(($i+1)) sleep 0.1 diff --git a/org.glite.jp.index/src/bones_server.c b/org.glite.jp.index/src/bones_server.c index 279254c..da846d8 100644 --- a/org.glite.jp.index/src/bones_server.c +++ b/org.glite.jp.index/src/bones_server.c @@ -14,6 +14,7 @@ #include #include #include +#include #include "conf.h" #include "db_ops.h" diff --git a/org.glite.jp.index/src/soap_ops.c b/org.glite.jp.index/src/soap_ops.c index f05abee..eb6880b 100644 --- a/org.glite.jp.index/src/soap_ops.c +++ b/org.glite.jp.index/src/soap_ops.c @@ -268,7 +268,7 @@ static int get_sql_cond(char **sql, const char *attr_md5, enum jptype__queryOp o if (get_op(op, &qop) != 0) return 0; if (attr_md5) trio_asprintf(&column, "attr_%|Ss.value", attr_md5); else asprintf(&column, "jobs.dg_jobid"); - trio_asprintf(sql, "%s %s \"%|Ss\"", column, qop, value); + trio_asprintf(sql, "%s %s '%|Ss'", column, qop, value); free(column); free(qop); if (op == jptype__queryOp__WITHIN) { @@ -277,7 +277,7 @@ static int get_sql_cond(char **sql, const char *attr_md5, enum jptype__queryOp o *sql = NULL; return EINVAL; } - trio_asprintf(&s, "%s AND \"%|Ss\"", *sql, value2); + trio_asprintf(&s, "%s AND '%|Ss'", *sql, value2); free(*sql); *sql = s; } return 0; diff --git a/org.glite.jp.index/src/soap_ps_calls.c b/org.glite.jp.index/src/soap_ps_calls.c index 0f9eed2..cc4595e 100644 --- a/org.glite.jp.index/src/soap_ps_calls.c +++ b/org.glite.jp.index/src/soap_ps_calls.c @@ -7,6 +7,7 @@ #include "glite/jp/types.h" #include "glite/jp/context.h" #include "glite/security/glite_gsplugin.h" +#include "glite/security/glite_gsplugin-int.h" #include "glite/security/glite_gscompat.h" #include "jp_H.h" -- 1.8.2.3