LDFLAGS:=${LDFLAGS} -pg
else
SRVBONES_LIB:= -L${stagedir}/lib -lglite_lbu_server_bones
- LB_COMMON_LIB:=-lglite_lb_common_${nothrflavour}
- LB_UTILS_DB_LIB:=-lglite_lbu_db
+ LB_COMMON_LIB:=-L${stagedir}/lib -lglite_lb_common_${nothrflavour}
+ LB_UTILS_DB_LIB:=-L${stagedir}/lib -lglite_lbu_db
LDFLAGS:= -L${stagedir}/lib
endif
ifeq (${nothrflavour},gcc32dbg)
vomsflavour :=
endif
-VOMS_LIBS:=-L${voms_prefix}/lib -lvomsc${vomsflavour}
+VOMS_LIBS:=-L${voms_prefix}/lib -lvomsapi${vomsflavour}
#EXT_LIBS:= \
# ${expatlib} -lexpat \
# -lvomsc${vomsflavour} \
ifneq (${classads_prefix},/usr)
- classadslib := -L${classads_prefix}/lib -lclassad
+ classadslib := -L${classads_prefix}/${archlib} -lclassad
endif
EXT_LIBS:= \
endif
endif
+<<<<<<< Makefile
compile: generate glite-lb-bkserverd glite-lb-bkindex glite-lb-mon-db ${STATIC_LIB_BK} ${PLUGIN_LIB} ${MAN_GZ}
+=======
+compile: glite-lb-bkserverd glite-lb-bkindex ${STATIC_LIB_BK} ${PLUGIN_LIB} store.c index.c jp_job_attrs.h
+>>>>>>> 1.101.2.10
generate: store.c index.c jp_job_attrs.h
rm -f LBTypes.wsdl
test.xml: test_xml
-# ./test_xml
+ ./test_xml
test_xml: test_xml.cpp
${CXX} -c ${CFLAGS} ${TEST_INC} $<
- ${LINKXX} -o $@ test_xml.o lb_xml_parse.o ${COMMON_LIBS} ${TEST_LIBS} ${EXT_LIBS}
+ ${LINKXX} -o $@ test_xml.o lb_xml_parse.o ${LB_COMMON_LIB} ${TEST_LIBS}
test.query: test_query_events
./test_query_events
#query_events_objs:=`echo ${BKSERVER_BASE_OBJS} |sed 's/lbs_db\.o//;s/lbs_db_supp\.o//;s/bkserverd\.o//;s/db_store\.o//;s/stored_master\.o//;s/store\.o//;s/srv_purge\.o//;s/load\.o//;s/dump\.o//;s/lb_proto\.o//;s/lb_html\.o//;s/lb_http\.o//;'`
+<<<<<<< Makefile
query_events_objs:=`echo ${BKSERVER_BASE_OBJS} |sed 's/bkserverd\.o//;'`
+=======
+#query_events_objs:=`echo ${BKSERVER_BASE_OBJS} |sed 's/lbs_db\.o//;s/lbs_db_supp\.o//;s/bkserverd\.o//;s/lb_authz\.o//'`
+>>>>>>> 1.101.2.10
-test_query_events: test_query_events.o
- ${LINKXX} -o $@ test_query_events.o ${query_events_objs} \
- ${TEST_LIBS} ${COMMON_LIBS} ${EXT_LIBS}
+query_events_objs := test_query_events.o query.o get_events.o jobstat_supp.o index.o
+
+test_query_events: ${query_events_objs}
+ ${LINKXX} -o $@ ${query_events_objs} \
+ ${TEST_LIBS} ${LB_COMMON_LIB}
+# ${TEST_LIBS} ${COMMON_LIBS} ${EXT_LIBS}
test.soapconv: test_soap_conv
./test_soap_conv
${INSTALL} -m 644 ${top_srcdir}/interface/job-attrs.xsd ${PREFIX}/interface
${INSTALL} -m 644 ${top_srcdir}/interface/job-record.xsd ${PREFIX}/interface
+<<<<<<< Makefile
if [ ${stagedir} != ${PREFIX} ]; then ${INSTALL} -m 755 ${stagedir}/bin/glite-lb-notif-interlogd ${PREFIX}/bin; fi
mkdir -p ${PREFIX}/include/${globalprefix}/${lbprefix}
(cd ${top_srcdir}/interface && install -m 644 ${HDRS} ${PREFIX}/include/${globalprefix}/${lbprefix})
if [ x${LB_STANDALONE} = x -a x${PLUGIN_LIB} != x ]; then \
${INSTALL} -m 755 ${PLUGIN_LIB} ${PREFIX}/lib; \
${INSTALL} -m 644 jp_job_attrs.h ${PREFIX}/include/${globalprefix}/${lbprefix} ; \
+=======
+ mkdir -p ${PREFIX}/include/${globalprefix}/${lbprefix}
+ (cd ${top_srcdir}/interface && install -m 644 ${HDRS} ${PREFIX}/include/${globalprefix}/${lbprefix})
+ install -m 644 ${STATIC_LIB_BK} ${PREFIX}/lib
+ if [ x${LB_STANDALONE} = x -a x${PLUGIN_LIB} != x ]; then \
+ ${INSTALL} -m 755 ${PLUGIN_LIB} ${PREFIX}/lib; \
+ ${INSTALL} -m 644 jp_job_attrs.h ${PREFIX}/include/${globalprefix}/${lbprefix} ; \
+>>>>>>> 1.101.2.10
fi
${INSTALL} -m 644 ${top_srcdir}/interface/srv_perf.h ${PREFIX}/include/${globalprefix}/${lbprefix}
clean:
+<<<<<<< Makefile
rm -rvf *.c *.h *.ch *.xh *.xml *.nsmap *.o *.lo .libs glite-lb-* ${STATIC_LIB_BK} ${PLUGIN_LIB} test*
rm -rvf log.xml project/ rpmbuild/ RPMS/ tgz/
+=======
+ rm -rf *.c *.h *.ch *.xh *.xml *.nsmap *.o *.lo .libs glite-lb-* ${STATIC_LIB_BK} test*
+>>>>>>> 1.101.2.10
%.c: %.c.T
rm -f $@
JobIndices = {
[ type = "system"; name = "owner" ],
[ type = "system"; name = "location" ],
- [ type = "system"; name = "destination" ]
+ [ type = "system"; name = "destination" ],
+ [ type = "system"; name = "lastUpdateTime" ]
}
]
$super $creds -i $pidfile $port $wport $dumpdir $purgedir $maildir" \
&& echo " done" || echo " FAILED"
- echo -n Starting glite-lb-notif-interlogd ...
- su - $GLITE_USER -c "$GLITE_LOCATION/bin/glite-lb-notif-interlogd \
- -f $GLITE_LB_NOTIF_FPREFIX -s $GLITE_LB_NOTIF_SOCK \
- $creds" && echo " done" || echo " FAILED"
+ if test -x $GLITE_LOCATION/bin/glite-lb-notif-interlogd; then
+ echo -n Starting glite-lb-notif-interlogd ...
+ su - $GLITE_USER -c "$GLITE_LOCATION/bin/glite-lb-notif-interlogd \
+ -f $GLITE_LB_NOTIF_FPREFIX -s $GLITE_LB_NOTIF_SOCK \
+ $creds" && echo " done" || echo " FAILED"
+ else
+ echo Warning: glite-lb-notif-interlogd not installed, LB notifications will not work
+ fi
}
stop()
<xs:element name="jobId" type="xs:string" />
+ <xs:element name="LBserver" type="xs:string" />
<xs:element name="user" type="xs:string">
<xs:annotation> <xs:documentation>Job owner according to LB</xs:documentation> </xs:annotation>
#ident "$Header$"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#ifndef NO_GACL
#include <gridsite.h>
#endif
extern void
edg_wll_FreeVomsGroups(edg_wll_VomsGroups *);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GLITE_LB_LB_AUTHZ_H */
-# $Id$
-# $Name$
-module.version=1.5.5
+# $Header$
+module.version=1.8.0
module.age=1
#endif
+#ifdef LB_PERF
+#include "glite/lb/lb_perftest.h"
+#include "glite/lb/srv_perf.h"
+
+enum lb_srv_perf_sink sink_mode;
+#endif
+
+
static struct option opts[] = {
{ "mysql",1,NULL,'m' },
{ "remove",0,NULL,'R' },
case EDG_WLL_QUERY_ATTR_USERTAG:
case EDG_WLL_QUERY_ATTR_HOST:
case EDG_WLL_QUERY_ATTR_CHKPT_TAG:
- return "char(250) binary null";
+ /* XXX: 255 may not be enough for location or destination */
+ return "varchar(255) binary null";
case EDG_WLL_QUERY_ATTR_TIME:
+ case EDG_WLL_QUERY_ATTR_STATEENTERTIME:
+ case EDG_WLL_QUERY_ATTR_LASTUPDATETIME:
return "datetime null";
default:
return NULL;
static void wait_for_open(edg_wll_Context,const char *);
static int decrement_timeout(struct timeval *, struct timeval, struct timeval);
+static int add_root(char *);
static int read_roots(const char *);
static int asyn_gethostbyaddr(char **, const char *, int, int, struct timeval *);
-static int amIroot(const char *);
+static int amIroot(const char *, char **);
static int parse_limits(char *, int *, int *, int *);
static int check_mkdir(const char *);
char socket_path_prefix[PATH_MAX] = GLITE_LBPROXY_SOCK_PREFIX;
+/* TODO: merge */
+<<<<<<< bkserverd.c
/* keep this at start of main() ! */
dtablesize = getdtablesize();
for (fd=3; fd < dtablesize ; fd++) close(fd);
+=======
+>>>>>>> 1.52.2.12
name = strrchr(argv[0],'/');
if (name) name++; else name = argv[0];
case 'X': notif_ilog_socket_path = strdup(optarg); break;
case 'Y': notif_ilog_file_prefix = strdup(optarg); break;
case 'i': strcpy(pidfile,optarg); break;
- case 'R': if (super_users) {
- fprintf(stderr,"%s: super-users already defined, second occurence ignored\n",
- argv[0]);
- break;
- }
- super_users = malloc(2 * sizeof super_users[0]);
- super_users[0] = optarg;
- super_users[1] = NULL;
- break;
- case 'F': if (super_users) {
- fprintf(stderr,"%s: super-users already defined, second occurence ignored\n",
- argv[0]);
- break;
- }
- if (read_roots(optarg)) return 1;
+ case 'R': add_root(optarg); break;
+ case 'F': if (read_roots(optarg)) return 1;
break;
case 'x': noIndex = atoi(optarg);
if (noIndex < 0 || noIndex > 2) { usage(name); return 1; }
semkey = ftok(pidfile,0);
+/* TODO: merge */
+<<<<<<< bkserverd.c
if (mode & SERVICE_SERVER) {
if (check_mkdir(dumpStorage)) exit(1);
if (check_mkdir(purgeStorage)) exit(1);
if (!debug) syslog(LOG_CRIT, "edg_wll_MaildirInit failed: %s", lbm_errdesc);
exit(1);
}
+=======
+ if (check_mkdir(dumpStorage)) exit(1);
+ if (check_mkdir(purgeStorage)) exit(1);
+ if ( jpreg ) {
+ if ( edg_wll_MaildirInit(jpregDir) ) {
+ dprintf(("[%d] edg_wll_MaildirInit failed: %s\n", getpid(), lbm_errdesc));
+ if (!debug) syslog(LOG_CRIT, "edg_wll_MaildirInit failed: %s", lbm_errdesc);
+ exit(1);
+>>>>>>> 1.52.2.12
}
}
use_dbcaps = ctx->dbcaps;
if (count_statistics) edg_wll_InitStatistics(ctx);
+ if ((ctx->dbcaps & GLITE_LBU_DB_CAP_TRANSACTIONS)) strict_locking = 1;
edg_wll_FreeContext(ctx);
if ( !debug ) {
{
struct clnt_data_t *cdata = (struct clnt_data_t *)data;
edg_wll_Context ctx;
+/* TODO: merge */
+<<<<<<< bkserverd.c
edg_wll_GssPrincipal client = NULL;
edg_wll_GssCred newcred = NULL;
+=======
+ gss_name_t client_name = GSS_C_NO_NAME;
+ gss_buffer_desc token = GSS_C_EMPTY_BUFFER;
+ gss_cred_id_t newcred = GSS_C_NO_CREDENTIAL;
+ gss_OID name_type = GSS_C_NO_OID;
+>>>>>>> 1.52.2.12
edg_wll_GssStatus gss_code;
struct timeval dns_to = {DNS_TIMEOUT, 0},
conn_start, now;
-/* don't care :-(
switch ( edg_wll_gss_watch_creds(server_cert, &cert_mtime) ) {
case 0: break;
case 1:
-*/
if ( !edg_wll_gss_acquire_cred_gsi(server_cert, server_key, &newcred, NULL, &gss_code) ) {
+/* TODO: merge */
+<<<<<<< bkserverd.c
dprintf(("[%d] reloading credentials\n", getpid()));
edg_wll_gss_release_cred(&mycred, NULL);
+=======
+ dprintf(("[%d] reloading credentials successful\n", getpid()));
+ gss_release_cred(&min_stat, &mycred);
+>>>>>>> 1.52.2.12
mycred = newcred;
} else { dprintf(("[%d] reloading credentials failed, using old ones\n", getpid())); }
-/*
break;
case -1: dprintf(("[%d] edg_wll_gss_watch_creds failed\n", getpid())); break;
}
-*/
if ( edg_wll_InitContext(&ctx) )
{
return 1;
}
+/* TODO: merge */
+<<<<<<< bkserverd.c
ret = edg_wll_gss_get_client_conn(&ctx->connections->serverConnection->gss, &client, NULL);
if (ret || client->flags & EDG_WLL_GSS_FLAG_ANON) {
dprintf(("[%d] annonymous client\n",getpid()));
if (ctx->peerName) free(ctx->peerName);
ctx->peerName = strdup(client->name);
edg_wll_gss_free_princ(client);
-
+=======
+ maj_stat = gss_inquire_context(&min_stat, ctx->connections->serverConnection->gss.context,
+ &client_name, NULL, NULL, NULL, NULL, NULL, NULL);
+ if ( !GSS_ERROR(maj_stat) )
+ maj_stat = gss_display_name(&min_stat, client_name, &token, &name_type);
+>>>>>>> 1.52.2.12
+
+/* TODO: merge */
+<<<<<<< bkserverd.c
dprintf(("[%d] client DN: %s\n",getpid(),ctx->peerName));
+=======
+ if ( !GSS_ERROR(maj_stat) )
+ {
+ if (ctx->peerName) free(ctx->peerName);
+ if (!edg_wll_gss_oid_equal(name_type, GSS_C_NT_ANONYMOUS)) {
+ ctx->peerName = (char *)token.value;
+ memset(&token, 0, sizeof(token));
+ dprintf(("[%d] client DN: %s\n",getpid(),ctx->peerName));
+ } else {
+ ctx->peerName = NULL;
+ dprintf(("[%d] anonymous client\n",getpid()));
+ }
+
+ /* XXX DK: pujde pouzit lifetime z inquire_context()?
+ *
+ ctx->peerProxyValidity = ASN1_UTCTIME_mktime(X509_get_notAfter(peer));
+ */
+
+>>>>>>> 1.52.2.12
}
+/* TODO: merge */
+<<<<<<< bkserverd.c
+=======
+ else
+ /* XXX DK: Check if the ANONYMOUS flag is set ?
+ */
+ dprintf(("[%d] anonymous client\n",getpid()));
+
+ if ( client_name != GSS_C_NO_NAME )
+ gss_release_name(&min_stat, &client_name);
+ if ( token.value )
+ gss_release_buffer(&min_stat, &token);
+>>>>>>> 1.52.2.12
if ( edg_wll_SetVomsGroups(ctx, &ctx->connections->serverConnection->gss, server_cert, server_key, vomsdir, cadir) )
{
for ( i = 0; i < ctx->vomsGroups.len; i++ )
dprintf(("\t%s:%s\n", ctx->vomsGroups.val[i].vo, ctx->vomsGroups.val[i].name));
}
+ if (debug && ctx->fqans && *(ctx->fqans))
+ {
+ char **f;
+
+ dprintf(("[%d] client's FQANs:\n",getpid()));
+ for (f = ctx->fqans; f && *f; f++)
+ dprintf(("\t%s\n", *f));
+ }
/* used also to reset start_time after edg_wll_ssl_accept! */
/* gettimeofday(&start_time,0); */
- ctx->noAuth = noAuth || amIroot(ctx->peerName);
+ ctx->noAuth = noAuth || amIroot(ctx->peerName, ctx->fqans);
switch ( noIndex )
{
case 0: ctx->noIndex = 0; break;
- case 1: ctx->noIndex = amIroot(ctx->peerName); break;
+ case 1: ctx->noIndex = amIroot(ctx->peerName, ctx->fqans); break;
case 2: ctx->noIndex = 1; break;
}
ctx->strict_locking = strict_locking;
ctx->greyjobs = greyjobs;
-
return 0;
}
case EDG_WLL_ERROR_GSS:
case EPIPE:
case EIO:
+ case EDG_WLL_IL_PROTO:
dprintf(("[%d] %s (%s)\n", getpid(), errt, errd));
if (!debug) syslog(LOG_ERR,"%s (%s)", errt, errd);
/* fallthrough
break;
case ENOENT:
- case EINVAL:
case EPERM:
case EEXIST:
case EDG_WLL_ERROR_NOINDEX:
case E2BIG:
dprintf(("[%d] %s (%s)\n", getpid(), errt, errd));
+ break;
+ case EINVAL:
+ case EDG_WLL_ERROR_PARSE_BROKEN_ULM:
+ case EDG_WLL_ERROR_PARSE_EVENT_UNDEF:
+ case EDG_WLL_ERROR_PARSE_MSG_INCOMPLETE:
+ case EDG_WLL_ERROR_PARSE_KEY_DUPLICITY:
+ case EDG_WLL_ERROR_PARSE_KEY_MISUSE:
+ case EDG_WLL_ERROR_PARSE_OK_WITH_EXTRA_FIELDS:
+ case EDG_WLL_ERROR_JOBID_FORMAT:
+ case EDG_WLL_ERROR_MD5_CLASH:
+ dprintf(("[%d] %s (%s)\n", getpid(), errt, errd));
if ( !debug ) syslog(LOG_ERR,"%s (%s)", errt, errd);
/*
* no action for non-fatal errors
*/
break;
+ case EDG_WLL_ERROR_DB_CALL:
+ case EDG_WLL_ERROR_SERVER_RESPONSE:
default:
dprintf(("[%d] %s (%s)\n", getpid(), errt, errd));
if (!debug) syslog(LOG_CRIT,"%s (%s)",errt,errd);
return (ar.err);
}
+static int add_root(char *root)
+{
+ char *null_suffix, **tmp;
+ int i, cnt;
+
+ for (cnt = 0; super_users && super_users[cnt]; cnt++)
+ ;
+ /* try to be compliant with the new FQAN format that excludes
+ the Capability and empty Role components */
+ null_suffix = strstr(root, "/Role=NULL/Capability=NULL");
+ if (null_suffix == NULL)
+ null_suffix = strstr(root, "/Capability=NULL");
+ i = (null_suffix == NULL) ? 0 : 1;
+
+ tmp = realloc(super_users, (cnt+2+i) * sizeof super_users[0]);
+ if (tmp == NULL)
+ return ENOMEM;
+ super_users = tmp;
+ super_users[cnt] = strdup(root);
+ if (null_suffix) {
+ *null_suffix = '\0'; /* changes the input, should be harmless */
+ super_users[++cnt] = strdup(root);
+ }
+ super_users[++cnt] = NULL;
+
+ return 0;
+}
+
static int read_roots(const char *file)
{
FILE *roots = fopen(file,"r");
char buf[BUFSIZ];
- int cnt = 0;
if (!roots) {
syslog(LOG_WARNING,"%s: %m, continuing without --super-users-file",file);
char *nl;
nl = strchr(buf,'\n');
if (nl) *nl = 0;
-
- super_users = realloc(super_users, (cnt+2) * sizeof super_users[0]);
- super_users[cnt] = strdup(buf);
- super_users[++cnt] = NULL;
+ add_root(buf);
}
fclose(roots);
return 0;
}
-static int amIroot(const char *subj)
+static int amIroot(const char *subj, char **fqans)
{
int i;
-
- if (!subj) return 0;
- for (i=0; super_users && super_users[i]; i++)
- if (strcmp(subj,super_users[i]) == 0) return 1;
+ char **f;
+
+ if (!subj && !fqans ) return 0;
+ for (i=0; super_users && super_users[i]; i++)
+ if (strncmp(super_users[i], "FQAN:", 5) == 0) {
+ 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;
return 0;
}
if(use_db) {
if (ctx->strict_locking && edg_wll_LockJob(ctx,ev->any.jobId)) goto err;
- if(edg_wll_StoreEvent(ctx, ev,&seq))
- goto err;
+ if(edg_wll_StoreEvent(ctx, ev,&seq)) {
+ edg_wll_UnlockJob(ctx,ev->any.jobId);
+ goto err;
+ }
}
if (!ctx->strict_locking && edg_wll_LockJob(ctx,ev->any.jobId)) goto err;
- if ( ev->any.type == EDG_WLL_EVENT_CHANGEACL )
+ if ( ev->any.type == EDG_WLL_EVENT_CHANGEACL ) {
err = edg_wll_UpdateACL(ctx, ev->any.jobId,
ev->changeACL.user_id, ev->changeACL.user_id_type,
ev->changeACL.permission, ev->changeACL.permission_type,
ev->changeACL.operation);
+
+ edg_wll_UnlockJob(ctx,ev->any.jobId);
+ }
else {
#ifdef LB_PERF
if(sink_mode == GLITE_LB_SINK_STATE) {
/* authorization check */
if ( !(ctx->noAuth) &&
- (!(ctx->peerName) || strcmp(ctx->peerName, jobstat.pub.owner))) {
+ (!(ctx->peerName) || !edg_wll_gss_equal_subj(ctx->peerName, jobstat.pub.owner))) {
intErr = (acl == NULL) || edg_wll_CheckACL(ctx, acl, EDG_WLL_PERM_READ);
if (intErr) {
free(string_jobid);
}
-/* called only when childen state changed
- */
-static edg_wll_ErrorCode update_parent_status(edg_wll_Context ctx, edg_wll_JobStatCode old_state, enum edg_wll_StatDone_code old_done_code, intJobStat *cis, edg_wll_Event *ce)
+/* returns state class of subjob of job collection */
+static subjobClassCodes class(edg_wll_JobStat *stat)
{
+/* TODO: merge */
+<<<<<<< jobstat.c
intJobStat *pis = NULL;
int update_hist = 0;
* cook artificial events to enable parent job state shift
*/
switch (cis->pub.state) {
+=======
+ switch (stat->state) {
+>>>>>>> 1.47.2.6
case EDG_WLL_JOB_RUNNING:
- if (load_parent_intJobStat(ctx, cis, &pis)) goto err;
- pis->pub.children_hist[cis->pub.state+1]++;
-
- if (pis->pub.jobtype == EDG_WLL_STAT_COLLECTION) {
- /* not RUNNING yet? */
- if (pis->pub.state < EDG_WLL_JOB_RUNNING) {
- if (log_collectionState_event(ctx, cis->pub.state, 0, cis, pis, ce))
- goto err;
- }
- }
- update_hist = 1;
+ return(SUBJOB_CLASS_RUNNING);
break;
case EDG_WLL_JOB_DONE:
+/* TODO: merge */
+<<<<<<< jobstat.c
if (load_parent_intJobStat(ctx, cis, &pis)) goto err;
pis->pub.children_hist[cis->pub.state+1]++;
pis->children_done_hist[cis->pub.done_code]++;
}
}
update_hist = 1;
+=======
+ if (stat->done_code == EDG_WLL_STAT_OK)
+ return(SUBJOB_CLASS_DONE);
+ else
+ // failed & cancelled
+ return(SUBJOB_CLASS_REST);
break;
+ case EDG_WLL_JOB_ABORTED:
+ return(SUBJOB_CLASS_ABORTED);
+>>>>>>> 1.47.2.6
+ break;
+/* TODO: merge */
+<<<<<<< jobstat.c
case EDG_WLL_JOB_CLEARED:
if (load_parent_intJobStat(ctx, cis, &pis)) goto err;
pis->pub.children_hist[cis->pub.state+1]++;
}
}
update_hist = 1;
+=======
+ case EDG_WLL_JOB_CLEARED:
+ return(SUBJOB_CLASS_CLEARED);
+>>>>>>> 1.47.2.6
break;
default:
- if (load_parent_intJobStat(ctx, cis, &pis)) goto err;
- pis->pub.children_hist[EDG_WLL_JOB_UNKNOWN+1]++;
- // update_hist = 1; - triggered by the next case or not needed
+ return(SUBJOB_CLASS_REST);
break;
}
+/* TODO: merge */
+<<<<<<< jobstat.c
if (update_hist)
+=======
+}
+
+/* Mapping of subjob class to some field in childen_hist */
+static edg_wll_JobStatCode class_to_statCode(subjobClassCodes code)
+{
+ switch (code) {
+ case SUBJOB_CLASS_RUNNING: return(EDG_WLL_JOB_RUNNING); break;
+ case SUBJOB_CLASS_DONE: return(EDG_WLL_JOB_DONE); break;
+ case SUBJOB_CLASS_ABORTED: return(EDG_WLL_JOB_ABORTED); break;
+ case SUBJOB_CLASS_CLEARED: return(EDG_WLL_JOB_CLEARED); break;
+ case SUBJOB_CLASS_REST: return(EDG_WLL_JOB_UNKNOWN); break;
+ default: assert(0); break;
+ }
+}
+
+/* count parent state from subjob histogram */
+static edg_wll_JobStatCode process_Histogram(intJobStat *pis)
+{
+ if (pis->pub.children_hist[class_to_statCode(SUBJOB_CLASS_RUNNING)+1] > 0) {
+ return EDG_WLL_JOB_RUNNING;
+ }
+ else if (pis->pub.children_hist[class_to_statCode(SUBJOB_CLASS_CLEARED)+1] == pis->pub.children_num) {
+ return EDG_WLL_JOB_CLEARED;
+ }
+ else if (pis->pub.children_hist[class_to_statCode(SUBJOB_CLASS_DONE)+1]
+ + pis->pub.children_hist[class_to_statCode(SUBJOB_CLASS_CLEARED)+1] == pis->pub.children_num) {
+ return EDG_WLL_JOB_DONE;
+ }
+ else if (pis->pub.children_hist[class_to_statCode(SUBJOB_CLASS_ABORTED)+1]
+ + pis->pub.children_hist[class_to_statCode(SUBJOB_CLASS_DONE)+1]
+ + pis->pub.children_hist[class_to_statCode(SUBJOB_CLASS_CLEARED)+1] == pis->pub.children_num) {
+ return EDG_WLL_JOB_ABORTED;
+ }
+ else
+ return EDG_WLL_JOB_WAITING;
+}
+
+static edg_wll_ErrorCode update_parent_status(edg_wll_Context ctx, edg_wll_JobStat *subjob_stat_old, intJobStat *cis, edg_wll_Event *ce)
+{
+ intJobStat *pis = NULL;
+ subjobClassCodes subjob_class, subjob_class_old;
+ edg_wll_JobStatCode parent_new_state;
+
+
+ subjob_class = class(&cis->pub);
+ subjob_class_old = class(subjob_stat_old);
+
+
+ if (subjob_class_old != subjob_class) {
+ if (load_parent_intJobStat(ctx, cis, &pis)) goto err;
+
+ pis->pub.children_hist[class_to_statCode(subjob_class)+1]++;
+ pis->pub.children_hist[class_to_statCode(subjob_class_old)+1]--;
+
+>>>>>>> 1.47.2.6
edg_wll_StoreSubjobHistogram(ctx, cis->pub.parent_job, pis);
+
+ if (pis->pub.jobtype == EDG_WLL_STAT_COLLECTION) {
+ parent_new_state = process_Histogram(pis);
+ if (pis->pub.state != parent_new_state) {
+ // XXX: we do not need EDG_WLL_STAT_code any more
+ // doneFailed subjob is stored in REST class and
+ // inducting collection Waiting state
+ // -> in future may be removed from collectionState event
+ // supposing collection Done state to be always DoneOK
+ if (log_collectionState_event(ctx, parent_new_state, EDG_WLL_STAT_OK, cis, pis, ce))
+ goto err;
+ }
+ }
+ }
+
err:
edg_wll_UnlockJob(ctx,cis->pub.parent_job);
}
+
/*
* update stored state according to the new event
* (must be called with the job locked)
/* check whether subjob state change does not change parent state */
if ((ijsp->pub.parent_job) && (oldstat.state != ijsp->pub.state)) {
- if (update_parent_status(ctx, oldstat.state, oldstat.done_code, ijsp, e))
+ if (update_parent_status(ctx, &oldstat, ijsp, e))
return edg_wll_SetError(ctx, EINVAL, "update_parent_status()");
}
* (includes edg_wll_JobStat API structure)
*/
-#define INTSTAT_VERSION "release-3.2.1_pbs"
+#define INTSTAT_VERSION "release-3.3.4"
// Internal error codes
char *deep_resubmit_seqcode;
branch_state *branch_states; // branch zero terminated array
-/* int expect_mask; */
- int children_done_hist[EDG_WLL_NUMBER_OF_DONE_CODES];
struct timeval last_pbs_event_timestamp;
int pbs_reruning; // true if rerun event arrived
} intJobStat;
EDG_WLL_PBS_EVENT_SOURCE__LAST
} edg_wll_PBSEventSource;
+/* TODO: merge */
+<<<<<<< jobstat.h
typedef enum _edg_wll_CondorEventSource {
EDG_WLL_CONDOR_EVENT_SOURCE_UNDEF = 0,
EDG_WLL_CONDOR_EVENT_SOURCE_COLLECTOR,
int edg_wll_JobStatus(edg_wll_Context, const edg_wlc_JobId, int, edg_wll_JobStat *);
+=======
+typedef enum _edg_wll_CondorEventSource {
+ EDG_WLL_CONDOR_EVENT_SOURCE_UNDEF = 0,
+ EDG_WLL_CONDOR_EVENT_SOURCE_COLLECTOR,
+ EDG_WLL_CONDOR_EVENT_SOURCE_MASTER,
+ EDG_WLL_CONDOR_EVENT_SOURCE_MATCH,
+ EDG_WLL_CONDOR_EVENT_SOURCE_NEGOTIATOR,
+ EDG_WLL_CONDOR_EVENT_SOURCE_SCHED,
+ EDG_WLL_CONDOR_EVENT_SOURCE_SHADOW,
+ EDG_WLL_CONDOR_EVENT_SOURCE_STARTER,
+ EDG_WLL_CONDOR_EVENT_SOURCE_START,
+ EDG_WLL_CONDOR_EVENT_SOURCE_JOBQUEUE,
+ EDG_WLL_CONDOR_EVENT_SOURCE__LAST
+} edg_wll_CondorEventSource;
+
+typedef enum _subjobClassCodes {
+ SUBJOB_CLASS_UNDEF = 0,
+ SUBJOB_CLASS_RUNNING,
+ SUBJOB_CLASS_DONE,
+ SUBJOB_CLASS_ABORTED,
+ SUBJOB_CLASS_CLEARED,
+ SUBJOB_CLASS_REST
+} subjobClassCodes;
+
+
+>>>>>>> 1.22.2.7
void destroy_intJobStat(intJobStat *);
void destroy_intJobStat_extension(intJobStat *p);
strpom=(char*)calloc(strlen(old)+1,sizeof(char));
- for (index=0; index <= itemsNo; index++) sprintf(strpom,"%s%d%s", strpom, item[index],index==itemsNo?"":";");
+ for (index=0; index <= itemsNo; index++) sprintf(strpom+strlen(strpom),"%d%s", item[index],index==itemsNo?"":";");
asprintf(&out,"%s%s ", old, strpom);
free(strpom);
if (ret) ret = enc_int(ret, stat->payload_running);
if (ret) ret = enc_strlist(ret, stat->possible_destinations);
if (ret) ret = enc_strlist(ret, stat->possible_ce_nodes);
+ if (ret) ret = enc_int(ret, stat->suspended);
+ if (ret) ret = enc_string(ret, stat->suspend_reason);
if (ret) ret = enc_int_array(ret, stat->children_hist, EDG_WLL_NUMBER_OF_STATCODES);
if (ret) ret = enc_string(ret, stat->pbs_state);
if (ret) ret = enc_string(ret, stat->pbs_queue);
if (ret) ret = enc_int(ret, stat->pbs_pid);
if (ret) ret = enc_int(ret, stat->pbs_exit_status);
if (ret) ret = enc_string(ret, stat->pbs_error_desc);
+ if (ret) ret = enc_string(ret, stat->condor_status);
+ if (ret) ret = enc_string(ret, stat->condor_universe);
+ if (ret) ret = enc_string(ret, stat->condor_owner);
+ if (ret) ret = enc_string(ret, stat->condor_preempting);
+ if (ret) ret = enc_int(ret, stat->condor_shadow_pid);
+ if (ret) ret = enc_int(ret, stat->condor_shadow_exit_status);
+ if (ret) ret = enc_int(ret, stat->condor_starter_pid);
+ if (ret) ret = enc_int(ret, stat->condor_starter_exit_status);
+ if (ret) ret = enc_int(ret, stat->condor_job_pid);
+ if (ret) ret = enc_int(ret, stat->condor_job_exit_status);
+ if (ret) ret = enc_string(ret, stat->condor_dest_host);
+ if (ret) ret = enc_string(ret, stat->condor_reason);
+ if (ret) ret = enc_string(ret, stat->condor_error_desc);
return ret;
}
if (tmp_in != NULL) stat->payload_running = dec_int(tmp_in, &tmp_in);
if (tmp_in != NULL) stat->possible_destinations = dec_strlist(tmp_in, &tmp_in);
if (tmp_in != NULL) stat->possible_ce_nodes = dec_strlist(tmp_in, &tmp_in);
+ if (tmp_in != NULL) stat->suspended = dec_int(tmp_in, &tmp_in);
+ if (tmp_in != NULL) stat->suspend_reason = dec_string(tmp_in, &tmp_in);
if (tmp_in != NULL) {
stat->children_hist = (int*)calloc(EDG_WLL_NUMBER_OF_STATCODES+1, sizeof(int));
dec_int_array(tmp_in, &tmp_in, stat->children_hist);
if (tmp_in != NULL) stat->pbs_pid = dec_int(tmp_in, &tmp_in);
if (tmp_in != NULL) stat->pbs_exit_status = dec_int(tmp_in, &tmp_in);
if (tmp_in != NULL) stat->pbs_error_desc = dec_string(tmp_in, &tmp_in);
+ if (tmp_in != NULL) stat->condor_status = dec_string(tmp_in, &tmp_in);
+ if (tmp_in != NULL) stat->condor_universe = dec_string(tmp_in, &tmp_in);
+ if (tmp_in != NULL) stat->condor_owner = dec_string(tmp_in, &tmp_in);
+ if (tmp_in != NULL) stat->condor_preempting = dec_string(tmp_in, &tmp_in);
+ if (tmp_in != NULL) stat->condor_shadow_pid = dec_int(tmp_in, &tmp_in);
+ if (tmp_in != NULL) stat->condor_shadow_exit_status = dec_int(tmp_in, &tmp_in);
+ if (tmp_in != NULL) stat->condor_starter_pid = dec_int(tmp_in, &tmp_in);
+ if (tmp_in != NULL) stat->condor_starter_exit_status = dec_int(tmp_in, &tmp_in);
+ if (tmp_in != NULL) stat->condor_job_pid = dec_int(tmp_in, &tmp_in);
+ if (tmp_in != NULL) stat->condor_job_exit_status = dec_int(tmp_in, &tmp_in);
+ if (tmp_in != NULL) stat->condor_dest_host = dec_string(tmp_in, &tmp_in);
+ if (tmp_in != NULL) stat->condor_reason = dec_string(tmp_in, &tmp_in);
+ if (tmp_in != NULL) stat->condor_error_desc = dec_string(tmp_in, &tmp_in);
*rest = tmp_in;
if (ret) ret = enc_string(ret, stat->last_branch_seqcode);
if (ret) ret = enc_string(ret, stat->deep_resubmit_seqcode);
if (ret) ret = enc_branch_states(ret, stat->branch_states);
- if (ret) ret = enc_int_array(ret, stat->children_done_hist, EDG_WLL_NUMBER_OF_DONE_CODES-1);
if (ret) ret = enc_timeval(ret, stat->last_pbs_event_timestamp);
if (ret) ret = enc_int(ret, stat->pbs_reruning);
return ret;
stat->branch_states = dec_branch_states(tmp_in, &tmp_in);
}
if (tmp_in != NULL) {
- dec_int_array(tmp_in, &tmp_in, stat->children_done_hist);
- }
- if (tmp_in != NULL) {
stat->last_pbs_event_timestamp = dec_timeval(tmp_in, &tmp_in);
}
if (tmp_in != NULL) {
char *names, *values;
char *data;
char *tmp;
+ char *tmpval;
edg_wll_IColumnRec *job_index_cols = (edg_wll_IColumnRec *)job_index_cols_v;
edg_wll_ResetError(ctx);
data = NULL;
switch (job_index_cols[i].qrec.attr) {
case EDG_WLL_QUERY_ATTR_OWNER:
- if (stat->pub.owner)
- trio_asprintf(&data, "'%|Ss'", stat->pub.owner);
- else data = strdup("''");
+ if (stat->pub.owner) {
+ tmpval = edg_wll_gss_normalize_subj(stat->pub.owner, 0);
+ trio_asprintf(&data, "'%|Ss'", tmpval);
+ free(tmpval);
+ } else data = strdup("''");
break;
case EDG_WLL_QUERY_ATTR_LOCATION:
if (stat->pub.location)
case EDG_WLL_QUERY_ATTR_RESUBMITTED:
asprintf(&data, "%d", stat->pub.resubmitted);
break;
+ case EDG_WLL_QUERY_ATTR_STATEENTERTIME:
+ data = strdup(edg_wll_TimeToDB(stat->pub.stateEnterTime.tv_sec));
+ break;
+ case EDG_WLL_QUERY_ATTR_LASTUPDATETIME:
+ data = strdup(edg_wll_TimeToDB(stat->pub.lastUpdateTime.tv_sec));
+ break;
/* XXX add more attributes when defined */
default:
int edg_wll_compare_pbs_seq(const char *a,const char *b)
{
- char timestamp_a[14], pos_a[10], ev_code_a, src_a;
- char timestamp_b[14], pos_b[10], ev_code_b, src_b;
+ char timestamp_a[14], pos_a[10], src_a;
+ char timestamp_b[14], pos_b[10], src_b;
+ int ev_code_a, ev_code_b;
int res;
- res = sscanf(a,"TIMESTAMP=%14s:POS=%10s:EV.CODE=%3d:SRC=%c", ×tamp_a, &pos_a, &ev_code_a, &src_a);
+ res = sscanf(a,"TIMESTAMP=%14s:POS=%10s:EV.CODE=%3d:SRC=%c", timestamp_a, pos_a, &ev_code_a, &src_a);
if (res != 4) {
syslog(LOG_ERR, "unparsable sequence code %s\n", a);
return -1;
}
- res = sscanf(b,"TIMESTAMP=%14s:POS=%10s:EV.CODE=%3d:SRC=%c", ×tamp_b, &pos_b, &ev_code_b, &src_b);
+ res = sscanf(b,"TIMESTAMP=%14s:POS=%10s:EV.CODE=%3d:SRC=%c", timestamp_b, pos_b, &ev_code_b, &src_b);
if (res != 4) {
syslog(LOG_ERR, "unparsable sequence code %s\n", b);
}
edg_wll_PBSEventSource get_pbs_event_source(const char *pbs_seq_num) {
- switch (pbs_seq_num[EDG_WLL_SEQ_PBS_SIZE-1]) {
+ switch (pbs_seq_num[EDG_WLL_SEQ_PBS_SIZE - 2]) {
case 'c': return(EDG_WLL_PBS_EVENT_SOURCE_SCHEDULER);
case 's': return(EDG_WLL_PBS_EVENT_SOURCE_SERVER);
case 'm': return(EDG_WLL_PBS_EVENT_SOURCE_MOM);
}
}
+/* TODO: merge */
+<<<<<<< jobstat_supp.c
edg_wll_CondorEventSource get_condor_event_source(const char *condor_seq_num) {
switch (condor_seq_num[EDG_WLL_SEQ_CONDOR_SIZE-1]) {
case 'L': return(EDG_WLL_CONDOR_EVENT_SOURCE_COLLECTOR);
}
}
+=======
+edg_wll_CondorEventSource get_condor_event_source(const char *condor_seq_num) {
+ switch (condor_seq_num[EDG_WLL_SEQ_CONDOR_SIZE - 2]) {
+ case 'L': return(EDG_WLL_CONDOR_EVENT_SOURCE_COLLECTOR);
+ case 'M': return(EDG_WLL_CONDOR_EVENT_SOURCE_MASTER);
+ case 'm': return(EDG_WLL_CONDOR_EVENT_SOURCE_MATCH);
+ case 'N': return(EDG_WLL_CONDOR_EVENT_SOURCE_NEGOTIATOR);
+ case 'C': return(EDG_WLL_CONDOR_EVENT_SOURCE_SCHED);
+ case 'H': return(EDG_WLL_CONDOR_EVENT_SOURCE_SHADOW);
+ case 's': return(EDG_WLL_CONDOR_EVENT_SOURCE_STARTER);
+ case 'S': return(EDG_WLL_CONDOR_EVENT_SOURCE_START);
+ case 'j': return(EDG_WLL_CONDOR_EVENT_SOURCE_JOBQUEUE);
+ default: return(EDG_WLL_CONDOR_EVENT_SOURCE_UNDEF);
+ }
+}
+
+>>>>>>> 1.26.2.10
int edg_wll_compare_seq(const char *a, const char *b)
{
unsigned int c[EDG_WLL_SOURCE__LAST];
/* XXX should be defined in gridsite-gacl.h */
GRSTgaclEntry *GACLparseEntry(xmlNodePtr cur);
+static int
+get_fqans(edg_wll_Context ctx, struct vomsdata *voms_info,
+ char ***fqans)
+{
+ struct voms **voms_cert = NULL;
+ char **f, **attrs, **tmp;
+ int ret, num;
+
+ attrs = NULL;
+ num = 0;
+
+ for (voms_cert = voms_info->data; voms_cert && *voms_cert; voms_cert++) {
+ for (f = (*voms_cert)->fqan; f && *f; f++) {
+ tmp = realloc(attrs, (num + 1) * sizeof(*attrs));
+ if (tmp == NULL) {
+ free(attrs);
+ return ENOMEM;
+ }
+ attrs = tmp;
+ attrs[num++] = strdup(*f);
+ }
+ }
+ if (attrs) {
+ tmp = realloc(attrs, (num + 1) * sizeof(*attrs));
+ if (tmp == NULL) {
+ free(attrs);
+ return ENOMEM;
+ }
+ attrs = tmp;
+ attrs[num++] = NULL;
+ }
+
+ *fqans = attrs;
+ return 0;
+}
+
static int
add_groups(edg_wll_Context ctx, struct voms *voms_cert, char *vo_name,
edg_wll_VomsGroups *groups)
memset (&ctx->vomsGroups, 0, sizeof(ctx->vomsGroups));
edg_wll_ResetError(ctx);
+/* TODO: merge */
+<<<<<<< lb_authz.c
+=======
+ if (ctx->fqans) {
+ char **f;
+ for (f = ctx->fqans; f && *f; f++)
+ free(*f);
+ free(ctx->fqans);
+ ctx->fqans = NULL;
+ }
+
+ ret = get_peer_cred(gss, server_cert, server_key, &p_chain, &cert);
+ if (ret) {
+// ret = 0;
+// XXX (MM): I do not know whether this error may be triggered by other
+// bugs too... The error message may be incomplete.
+ edg_wll_SetError(ctx, errno, "cert/key file not owned by process owner?");
+ goto end;
+ }
+
+ /* exit if peer's credentials are not available */
+ if (p_chain == NULL || cert == NULL) {
+ ret = 0;
+ goto end;
+ }
+
+>>>>>>> 1.11.8.1
/* uses X509_CERT_DIR and X509_VOMS_DIR vars */
voms_info = VOMS_Init(voms_dir, ca_dir);
if (voms_info == NULL) {
}
ret = get_groups(ctx, voms_info, &ctx->vomsGroups);
+ if (ret)
+ goto end;
+
+ ret = get_fqans(ctx, voms_info, &ctx->fqans);
end:
if (voms_info)
"<h2><B>User jobs</B></h2>\r\n"
"User subject: %s<p>"
"<ul>%s</ul>"
- "\t</body>\r\n</html>",ctx->peerName,pomB);
+ "\t</body>\r\n</html>",ctx->peerName?ctx->peerName: "<anonymous>",pomB);
free(pomB);
*message = pomA;
if ( ctx->isProxy ) err = edg_wll_http_recv_proxy(ctx,&req,&hdr,&body);
else err = edg_wll_http_recv(ctx,&req,&hdr,&body,ctx->connections->serverConnection);
- dprintf(("[%d] %s\n",getpid(),req));
- if (body) dprintf(("\n%s\n\n",body));
+ if (req) dprintf(("[%d] request: %s\n",getpid(),req));
+ else dprintf(("no request\n"));
+ if (body) dprintf(("request body:\n%s\n\n",body));
if (!err) {
if ((err = edg_wll_Proto(ctx,req,hdr,body,&resp,&hdrOut,&bodyOut)))
av[0].size = -1;
av[0].timestamp = h->status.lastUpdateTime.tv_sec;
}
+ } else if (strcmp(attr, GLITE_JP_LB_LBserver) == 0) {
+ av = calloc(2, sizeof(glite_jp_attrval_t));
+ av[0].name = strdup(attr);
+ av[0].value = edg_wlc_JobIdGetServer(h->status.jobId);
+ av[0].size = -1;
+ av[0].timestamp = h->status.lastUpdateTime.tv_sec;
} else if (strcmp(attr, GLITE_JP_LB_parent) == 0) {
if (h->status.parent_job) {
av = calloc(2, sizeof(glite_jp_attrval_t));
int maxnstates, nstates, i, be_strict = 0, retval;
char *errstring;
edg_wll_JobStatCode old_state = EDG_WLL_JOB_UNDEF;
+ int lastStatusHistoryIndex = -1;
js = calloc(1, sizeof(intJobStat));
init_intJobStat(js);
if (nstates >= maxnstates) {
maxnstates <<= 1;
h->fullStatusHistory = realloc(h->fullStatusHistory, maxnstates * sizeof(lb_historyStatus *));
+ if (lastStatusHistoryIndex > -1)
+ h->lastStatusHistory = &(h->fullStatusHistory[lastStatusHistoryIndex]);
}
/* job owner and jobId not filled from events normally */
/* lastStatusHistory starts from the last WAITING state */
if (js->pub.state == EDG_WLL_JOB_WAITING) {
h->lastStatusHistory = &(h->fullStatusHistory[nstates]);
+ lastStatusHistoryIndex = nstates;
}
/* finalStatus is the one preceeding the CLEARED state */
if ( (js->pub.state == EDG_WLL_JOB_CLEARED) && (nstates > 0) ) {
#define KEY_AGENT "User-Agent"
-const char* const response_headers[] = {
+static const char* const response_headers_dglb[] = {
"Cache-Control: no-cache",
- "Accept: application/x-dglb",
- "User-Agent: edg_wll_Server/" PROTO_VERSION "/" COMP_PROTO,
+ "Server: edg_wll_Server/" PROTO_VERSION "/" COMP_PROTO,
"Content-Type: application/x-dglb",
NULL
};
+static const char* const response_headers_html[] = {
+ "Cache-Control: no-cache",
+ "Server: edg_wll_Server/" PROTO_VERSION "/" COMP_PROTO,
+ "Content-Type: text/html",
+ NULL
+};
+
extern int edg_wll_NotifNewServer(edg_wll_Context,
edg_wll_QueryRec const * const *, char const *,
const edg_wll_NotifId, time_t *);
} else ret = HTTP_NOTALLOWED;
errV21: asprintf(response,"HTTP/1.1 %d %s",ret,edg_wll_HTTPErrorMessage(ret));
- *headersOut = (char **) response_headers;
+ *headersOut = (char **) (html? response_headers_html : response_headers_dglb);
if ((ret != HTTP_OK) && html)
*bodyOut = edg_wll_ErrorToHTML(ctx,ret);
else
if ( strstr(headers[i], KEY_AGENT) ) break;
if (headers[i] == NULL) { ret = HTTP_BADREQ; goto err; } /* if not present */
- switch (is_protocol_incompatible(headers[i])) {
- case 0 : /* protocols compatible */
- ctx->is_V21 = 0;
- break;
- case -1 : /* malformed 'User Agent:' line */
- ret = HTTP_BADREQ;
- goto err;
- break;
- case 1 : /* protocols incompatible */
- /* try old (V21) version compatibility */
- edg_wll_ProtoV21(ctx, request, headers, messageBody,
- response, headersOut, bodyOut);
-
- /* and propagate errors or results */
- return edg_wll_Error(ctx,NULL,NULL);
- break;
- case -2 : /* version of one protocol unknown */
- /* fallthrough */
- default : ret = HTTP_UNSUPPORTED;
- edg_wll_SetError(ctx,ENOTSUP,"Protocol versions are incompatible.");
- goto err;
- break;
+ if (!html) {
+ switch (is_protocol_incompatible(headers[i])) {
+ case 0 : /* protocols compatible */
+ ctx->is_V21 = 0;
+ break;
+ case -1 : /* malformed 'User Agent:' line */
+ ret = HTTP_BADREQ;
+ goto err;
+ break;
+ case 1 : /* protocols incompatible */
+ /* try old (V21) version compatibility */
+ edg_wll_ProtoV21(ctx, request, headers, messageBody,
+ response, headersOut, bodyOut);
+
+ /* and propagate errors or results */
+ return edg_wll_Error(ctx,NULL,NULL);
+ break;
+ case -2 : /* version of one protocol unknown */
+ /* fallthrough */
+ default : ret = HTTP_UNSUPPORTED;
+ edg_wll_SetError(ctx,ENOTSUP,"Protocol versions are incompatible.");
+ goto err;
+ break;
+ }
}
flags = (requestPTR[1]=='?') ? edg_wll_string_to_stat_flags(requestPTR + 2) : 0;
// FIXME: edg_wll_UserJobs should take flags as parameter
- if (!ctx->peerName) {
- edg_wll_SetError(ctx,EPERM,"Operation not permitted.");
- ret = HTTP_UNAUTH;
- }
switch (edg_wll_UserJobs(ctx,&jobsOut,NULL)) {
case 0: if (html) edg_wll_UserJobsToHTML(ctx, jobsOut, &message);
else ret = HTTP_OK;
break;
case ENOENT: ret = HTTP_NOTFOUND; break;
+ case EPERM: ret = HTTP_UNAUTH; break;
+ case EDG_WLL_ERROR_NOINDEX: ret = HTTP_UNAVAIL; break;
default: ret = HTTP_INTERNAL; break;
}
if (!html && (ret != HTTP_INTERNAL))
}
switch ( retCode ) {
- // case EPERM : ret = HTTP_UNAUTH;
- // /* soft-error fall through */
case 0: if (html) ret = HTTP_NOTIMPL;
else ret = HTTP_OK;
} else ret = HTTP_NOTALLOWED;
err: asprintf(response,"HTTP/1.1 %d %s",ret,edg_wll_HTTPErrorMessage(ret));
- *headersOut = (char **) response_headers;
+ *headersOut = (char **) (html ? response_headers_html : response_headers_dglb);
if ((ret != HTTP_OK) && html)
*bodyOut = edg_wll_ErrorToHTML(ctx,ret);
else
#include "glite/lb/context.h"
-extern const char* const response_headers[];
-
/* Handle a single request of the LB server protocol
* returns a complete response string (may contain a formatted error
* message)
XMLCtx->dumpRequestGlobal.from = edg_wll_StringToDumpConst(s);
}
else if (!strcmp(XMLCtx->element,"to")) {
- if (isdigit(s))
+ if (isdigit(s[0]))
XMLCtx->dumpRequestGlobal.to = edg_wll_from_string_to_time_t(XMLCtx);
else
XMLCtx->dumpRequestGlobal.to = edg_wll_StringToDumpConst(s);
char *userid = NULL,
*q = NULL;
int ret;
-
+ char *can_peername = NULL;
if ( !ctx->peerName )
{
edg_wll_SetError(ctx, EPERM, "Annonymous access not allowed");
goto cleanup;
}
- trio_asprintf(&q, "select userid from users where cert_subj='%|Ss'", ctx->peerName);
+ can_peername = edg_wll_gss_normalize_subj(ctx->peerName, 0);
+ trio_asprintf(&q, "select userid from users where cert_subj='%|Ss'", can_peername);
if ( edg_wll_ExecSQL(ctx, q, &stmt) < 0 )
goto cleanup;
}
free(q);
trio_asprintf(&q, "insert into users(userid,cert_subj) values ('%|Ss','%|Ss')",
- userid, ctx->peerName);
+ userid, can_peername);
if ( edg_wll_ExecSQL(ctx, q, NULL) < 0 )
{
if ( edg_wll_Error(ctx,NULL,NULL) != EEXIST )
cleanup:
if ( q ) free(q);
if ( stmt ) glite_lbu_FreeStmt(&stmt);
+ free(can_peername);
return userid;
}
int ret;
+ /* XXX: rewrite select below in order to handle cert_subj format changes */
if ( !(user = get_user(ctx, 0)) )
{
if ( !edg_wll_Error(ctx, NULL, NULL) )
}
#define rep(a,b) { free(a); a = (b == NULL) ? NULL : strdup(b); }
+#define rep_cond(a,b) { if (b) { free(a); a = strdup(b); } }
static void free_stringlist(char ***lptr)
{
int lm_favour_lrms = 0;
- if (old_state == EDG_WLL_JOB_ABORTED ||
+ // Aborted may not be terminal state for collection in some cases
+ // i.e. if some Done/failed subjob is resubmitted
+ if ( (old_state == EDG_WLL_JOB_ABORTED && e->any.type != EDG_WLL_EVENT_COLLECTIONSTATE) ||
old_state == EDG_WLL_JOB_CANCELLED ||
old_state == EDG_WLL_JOB_CLEARED) {
res = RET_LATE;
}
#endif
break;
+ case EDG_WLL_EVENT_SUSPEND:
+ if (USABLE(res, strict)) {
+ if (js->pub.state == EDG_WLL_JOB_RUNNING) {
+ js->pub.suspended = 1;
+ rep(js->pub.suspend_reason, e->suspend.reason);
+ }
+ }
+ break;
+ case EDG_WLL_EVENT_RESUME:
+ if (USABLE(res, strict)) {
+ if (js->pub.state == EDG_WLL_JOB_RUNNING) {
+ js->pub.suspended = 0;
+ rep(js->pub.suspend_reason, e->resume.reason);
+ }
+ }
+ break;
case EDG_WLL_EVENT_RESUBMISSION:
if (USABLE(res, strict)) {
if (e->resubmission.result == EDG_WLL_RESUBMISSION_WONTRESUB) {
js->pub.state = EDG_WLL_JOB_SUBMITTED;
}
if (USABLE_DATA(res, strict)) {
- rep(js->pub.jdl, e->regJob.jdl);
+ rep_cond(js->pub.jdl, e->regJob.jdl);
edg_wlc_JobIdFree(js->pub.parent_job);
edg_wlc_JobIdDup(e->regJob.parent,
&js->pub.parent_job);
rep(js->last_cancel_seqcode, e->any.seqcode);
} else {
-/* the first set of LM events (Accept, Transfer* -> LRMS)
+/* the first set of LM events (Accept, Transfer/- -> LRMS)
should not should shift the state (to Ready, Scheduled) but NOT to
update js->last_seqcode completely, in order not to block following
LRMS events which are likely to arrive later but should still affect
else rep(js->last_seqcode, e->any.seqcode);
}
+ if (js->pub.state != EDG_WLL_JOB_RUNNING) {
+ js->pub.suspended = 0;
+ rep(js->pub.suspend_reason, NULL);
+ }
+
if (fine_res == RET_GOODBRANCH) {
rep(js->last_branch_seqcode, e->any.seqcode);
}
ret = 0,
offset = 0, limit = 0,
limit_loop = 1,
+/* TODO: merge */
+<<<<<<< query.c
eperm = 0,
where_flags = 0;
char *j_old = NULL;
int match_status_old = 0;
edg_wll_JobStat state_out;
+=======
+ eperm = 0;
+ char *peerid = NULL;
+ char *can_peername = NULL, *can_peerid = NULL;
+>>>>>>> 1.10.2.3
edg_wll_ResetError(ctx);
memset(&state_out, 0, sizeof(edg_wll_JobStat));
!(job_where = jc_to_head_where(ctx, job_conditions, &where_flags)) )
if (!ctx->noIndex) goto cleanup;
+ if (ctx->peerName) peerid = strdup(strmd5(ctx->peerName,NULL));
+ can_peername = edg_wll_gss_normalize_subj(ctx->peerName, 0);
+ if (can_peername) can_peerid = strdup(strmd5(can_peername,NULL));
+
/* XXX: similar query in srv_purge.c ! They has to match due to common
* convert_event_head() called on the result
*/
// Auth checked in edg_wll_JobStatus above
if ( !(where_flags & FL_FILTER) && !noAuth )
{
- if (!ctx->peerName || strcmp(res[1],strmd5(ctx->peerName,NULL))) {
+ if (!ctx->peerName || (strcmp(res[1],peerid) && strcmp(res[1], can_peerid))) {
edg_wll_Acl acl = NULL;
char *jobid = NULL;
free(qbase);
free(job_where);
free(event_where);
+/* TODO: merge */
+<<<<<<< query.c
free(j_old);
if (state_out.jobId) edg_wll_FreeStatus(&state_out);
+=======
+ free(peerid);
+ free(can_peername); free(can_peerid);
+>>>>>>> 1.10.2.3
return edg_wll_Error(ctx,NULL,NULL);
}
int ct, n, m;
char *aux,
*tmps,
+ *tmps2,
*dbt,
*cname = NULL,
msg[100];
char *conds, *retconds;
-
+ char *can_peername = NULL;
retconds = conds = NULL;
return NULL;
}
+ tmps2 = edg_wll_gss_normalize_subj(jc[m][n].value.c, 0);
+ if (!jc[m][n].value.c && !can_peername) {
+ can_peername = edg_wll_gss_normalize_subj(ctx->peerName, 0);
+ }
+
*where_flags |= FL_SEL_STATUS;
if ( conds )
{
if ( jc[m][n].value.c )
- trio_asprintf(&tmps, "%s OR s.%s%s'%|Ss'", conds, cname, opToString(jc[m][n].op), jc[m][n].value.c);
+ trio_asprintf(&tmps, "%s OR s.%s%s'%|Ss'", conds, cname, opToString(jc[m][n].op), tmps2);
else
- trio_asprintf(&tmps, "%s OR s.%s%s'%|Ss'", conds, cname, opToString(jc[m][n].op), ctx->peerName);
+ trio_asprintf(&tmps, "%s OR s.%s%s'%|Ss'", conds, cname, opToString(jc[m][n].op), can_peername);
free(conds); conds = tmps;
}
else
{
if ( jc[m][n].value.c )
- trio_asprintf(&conds, "s.%s%s'%|Ss'", cname, opToString(jc[m][n].op), jc[m][n].value.c);
+ trio_asprintf(&conds, "s.%s%s'%|Ss'", cname, opToString(jc[m][n].op), tmps2);
else
- trio_asprintf(&conds, "s.%s%s'%|Ss'", cname, opToString(jc[m][n].op), ctx->peerName);
+ trio_asprintf(&conds, "s.%s%s'%|Ss'", cname, opToString(jc[m][n].op), can_peername);
}
+ free(tmps2);
break;
case EDG_WLL_QUERY_ATTR_DONECODE:
}
}
+ free(can_peername);
return retconds;
}
case EDG_WLL_QUERY_ATTR_OWNER:
if (stat->owner) {
if (conds[i][j].value.c) {
- if (!strcmp(conds[i][j].value.c, stat->owner) ) {
+ if (edg_wll_gss_equal_subj(conds[i][j].value.c, stat->owner) ) {
if ( conds[i][j].op == EDG_WLL_QUERY_OP_EQUAL ) goto or_satisfied;
} else if ( conds[i][j].op == EDG_WLL_QUERY_OP_UNEQUAL ) goto or_satisfied;
} else if (ctx->peerName) {
- if (!strcmp(ctx->peerName, stat->owner) ) {
+ if (edg_wll_gss_equal_subj(ctx->peerName, stat->owner) ) {
if ( conds[i][j].op == EDG_WLL_QUERY_OP_EQUAL ) goto or_satisfied;
} else if ( conds[i][j].op == EDG_WLL_QUERY_OP_UNEQUAL ) goto or_satisfied;
}
trans_db_store(edg_wll_Context ctx, char *event_data, edg_wll_Event *e, intJobStat *is)
{
int ret;
+ char *errd = NULL;
if ((ret = edg_wll_Transaction(ctx) != 0)) goto err;
if (ret == 0) {
if ((ret = edg_wll_Commit(ctx)) != 0) goto err;
} else {
+ edg_wll_Error(ctx, NULL, &errd);
edg_wll_Rollback(ctx);
+ edg_wll_SetError(ctx, ret, errd);
+ free(errd);
}
err:
static const char* const resp_headers[] = {
"Cache-Control: no-cache",
- "Accept: application/x-dglb",
- "User-Agent: edg_wll_Server/" PROTO_VERSION "/" COMP_PROTO,
+ "Server: edg_wll_Server/" PROTO_VERSION "/" COMP_PROTO,
"Content-Type: application/x-dglb",
NULL
};
if ( (request->flags & EDG_WLL_PURGE_SERVER_DUMP) &&
((dumpfile = edg_wll_CreateTmpPurgeFile(ctx, &tmpfname)) == -1 ) )
- return edg_wll_Error(ctx, NULL, NULL);
+ goto abort;
+ /*
+ should be changed so that only purged events are sent to whole-server dumps
+ (with this commented out, severely delayed events (>purge interval) can miss
+ whole-server dumps, but it is more acceptable than invoking whole-server dump
+ on each purge request (whole-server dumps are used rarely if at all)
if (request->flags&EDG_WLL_PURGE_REALLY_PURGE) {
edg_wll_DumpRequest req = {
EDG_WLL_DUMP_LAST_END, EDG_WLL_DUMP_NOW
{
if ( request->flags & EDG_WLL_PURGE_SERVER_DUMP )
unlink(tmpfname);
- return edg_wll_Error(ctx, NULL, NULL);
+ goto abort;
}
}
+ */
if (request->jobs) for (i=0; request->jobs[i]; i++) {
if (edg_wlc_JobIdParse(request->jobs[i],&job)) {
}
}
glite_lbu_FreeStmt(&s);
+
abort:
- // just for escaping from nested cycles
- ; /* prevent compiler to complain */
- }
if (parse && !edg_wll_Error(ctx,NULL,NULL))
{
#ifndef LB_DAG_EMBRIONIC
static int register_subjobs(edg_wll_Context,const edg_wll_RegJobEvent *);
#endif
-static int register_subjobs_embryonic(edg_wll_Context,const edg_wll_RegJobEvent *);
+static int register_subjobs_embryonic(edg_wll_Context,const edg_wll_RegJobEvent *, const char *);
void edg_wll_StoreAnonymous(edg_wll_Context ctx,int anon) {
ctx->allowAnonymous = anon;
{
edg_wll_ErrorCode err = 0;
char *userid = NULL,*jobid,*stmt;
+ char *userid_job = NULL;
char *select_max,*ssrc;
glite_lbu_Statement sh = NULL;
int next = 0xDEAD;
jobid = edg_wlc_JobIdGetUnique(e->any.jobId);
+/* TODO: merge */
+<<<<<<< store.c.T
trio_asprintf(&stmt,"select userid from jobs where jobid='%|Ss'", jobid);
if (edg_wll_ExecSQL(ctx,stmt,&sh) < 0 || edg_wll_FetchRow(ctx,sh,1,NULL,&userid) < 0) goto clean;
if (sh) glite_lbu_FreeStmt(&sh);
+=======
+ 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;
+
+ if (!ctx->isProxy && ctx->peerName != NULL) {
+ username = edg_wll_gss_normalize_subj(ctx->peerName, 0);
+ } else {
+ username = edg_wll_gss_normalize_subj(e->any.user, 0);
+ }
+ userid_job = strdup(strmd5(username, NULL));
+ if (strcmp(username,e->any.user)) {
+ if ((err = store_user(ctx,userid_job, username))) goto clean;
+ }
+ if ((err = store_user(ctx,userid,e->any.user))) goto clean;
+ if ((err = store_job(ctx,e->any.jobId,userid_job))) goto clean;
+ } else {
+ /* for other events just make sure user record is there */
+ if ((err = store_user(ctx,userid,e->any.user))) goto clean;
+ }
+>>>>>>> 1.24.2.7
/* obtain next event sequence number */
/* try to insert (someone else may be doing the same) */
while (1) {
+/* TODO: merge */
+<<<<<<< store.c.T
char *max, *stamp;
+=======
+ char *max = NULL;
+>>>>>>> 1.24.2.7
if (edg_wll_ExecSQL(ctx,select_max,&sh) < 0 ||
edg_wll_FetchRow(ctx,sh,1,NULL,&max) < 0)
/* we were late -- try once again */
free(stmt);
+ free(max);
}
free(stmt); stmt = NULL;
e->regJob.nsubjobs > 0)
#ifdef LB_DAG_EMBRIONIC
- err = register_subjobs_embryonic(ctx,&e->regJob);
+ err = register_subjobs_embryonic(ctx,&e->regJob,userid_job);
#else
err = register_subjobs(ctx,&e->regJob);
#endif
clean:
free(now_s);
free(userid);
+ free(userid_job);
free(jobid);
free(stmt);
free(ssrc);
{
char *jobid = edg_wlc_JobIdGetUnique(e->any.jobId);
char *q = NULL,*owner = NULL;
+/* TODO: merge */
+<<<<<<< store.c.T
glite_lbu_Statement stmt = NULL;
char *user;
+=======
+ edg_wll_Stmt stmt = NULL;
+/* TODO: merge */
+>>>>>>> 1.24.2.7
edg_wll_ResetError(ctx);
+<<<<<<< store.c.T
trio_asprintf(&q,"select userid from jobs where jobid='%|Ss'",jobid);
+=======
+ if (!ctx->isProxy && !ctx->peerName)
+ return edg_wll_SetError(ctx,EPERM,"can't store using unauthenticated connection");
+
+ if (e->type == EDG_WLL_EVENT_REGJOB)
+ return strcmp(e->any.user,EDG_WLL_LOG_USER_DEFAULT) ?
+ 0 : edg_wll_SetError(ctx,EPERM,"can't register jobs anonymously");
+
+ trio_asprintf(&q,"select u.cert_subj from jobs j, users u "
+ "where j.jobid='%|Ss' and u.userid=j.userid",jobid);
+>>>>>>> 1.24.2.7
if (edg_wll_ExecSQL(ctx,q,&stmt) < 0
|| edg_wll_FetchRow(ctx,stmt,1,NULL,&owner) < 0
case EDG_WLL_SOURCE_USER_INTERFACE:
case EDG_WLL_SOURCE_LRMS:
case EDG_WLL_SOURCE_APPLICATION:
- user = strmd5(e->any.user,NULL);
- if (strcmp(owner,user)) edg_wll_SetError(ctx,EPERM,"check_auth()");
+ if (!edg_wll_gss_equal_subj(owner,e->any.user))
+ edg_wll_SetError(ctx,EPERM,"check_auth()");
break;
default:
/* XXX: just don't allow anonymous */
stat->pub.owner = strdup(e->user);
stat->pub.jobtype = EDG_WLL_STAT_SIMPLE;
stat->pub.stateEnterTimes[1 + EDG_WLL_JOB_SUBMITTED] = (int)e->timestamp.tv_sec;
+ stat->pub.lastUpdateTime = e->timestamp;
jobid_md5 = edg_wlc_JobIdGetUnique(jobid);
parent_md5 = edg_wlc_JobIdGetUnique(e->jobId);
return edg_wll_Error(ctx,NULL,NULL);
}
-static int register_subjobs_embryonic(edg_wll_Context ctx,const edg_wll_RegJobEvent *e)
+static int register_subjobs_embryonic(edg_wll_Context ctx,const edg_wll_RegJobEvent *e, const char *userid)
{
int i, err = 0;
edg_wlc_JobId *subjobs;
struct timeval now;
- char *userid = strdup(strmd5(e->user,NULL));
char *jobid_md5, *jobid_md5_old;
size_t jobid_len;
#ifdef LB_BUF
gss_reader(void *user_data, char *buffer, int max_len)
{
edg_wll_Context tmp_ctx = (edg_wll_Context)user_data;
- int ret, len;
+ int ret;
+ size_t len;
edg_wll_GssStatus gss_code;
ret = edg_wll_gss_read_full(&tmp_ctx->connections->serverConnection->gss,
if(ret < 0) {
switch(ret) {
+ case EDG_WLL_GSS_ERROR_GSS:
+ edg_wll_SetErrorGss(tmp_ctx,"gss_reader",&gss_code);
+ break;
+
case EDG_WLL_GSS_ERROR_TIMEOUT:
- edg_wll_SetError(tmp_ctx, ETIMEDOUT, "read message");
+ edg_wll_SetError(tmp_ctx, ETIMEDOUT, "gss_reader");
break;
case EDG_WLL_GSS_ERROR_EOF:
edg_wll_SetError(tmp_ctx, ENOTCONN, NULL);
break;
+ case EDG_WLL_GSS_ERROR_ERRNO:
+ edg_wll_SetError(tmp_ctx, errno, "gss_reader");
+ break;
+
default:
- edg_wll_SetError(tmp_ctx, EDG_WLL_ERROR_GSS, "read message");
+ edg_wll_SetError(tmp_ctx, EDG_WLL_ERROR_GSS, "gss_reader");
break;
}
+ ret = -2; /* -1 is used by read_il_data internals */
}
return(ret);
int edg_wll_StoreProtoServer(edg_wll_Context ctx)
{
char *buf;
- int len,ret;
+ size_t len;
+ int ret;
size_t total;
edg_wll_GssStatus gss_code;
edg_wll_ResetError(ctx);
ret = read_il_data(ctx, &buf, gss_reader);
- if (ret == EDG_WLL_GSS_ERROR_EOF)
- return edg_wll_SetError(ctx,ENOTCONN,"client side");
- if(ret < 0)
- return edg_wll_SetError(ctx,EIO,"interlogger protocol");
+ if (ret == -1)
+ return edg_wll_SetError(ctx,EIO,"interlogger protocol error");
+ if (ret < 0)
+ return edg_wll_Error(ctx,NULL,NULL);
#ifdef LB_PERF
if (sink_mode == GLITE_LB_SINK_PARSE) glite_wll_perftest_consumeEventIlMsg(buf);
else
ret = edg_wll_plain_read_full(&tmp_ctx->connProxy->conn, buffer, max_len,
&tmp_ctx->p_tmp_timeout);
- if(ret < 0)
- edg_wll_SetError(tmp_ctx, errno, "StoreProtoProxy() - reading data");
+ if(ret < 0) {
+ edg_wll_SetError(tmp_ctx, errno, "gss_plain_reader");
+ return -2;
+ }
return(ret);
}
edg_wll_ResetError(ctx);
ret = read_il_data(ctx, &buf, gss_plain_reader);
- if ( ret < 0 ) return(ret);
+ if (ret == -1)
+ return edg_wll_SetError(ctx,EIO,"interlogger protocol error");
+ if (ret < 0)
+ return edg_wll_Error(ctx,NULL,NULL);
#ifdef LB_PERF
if (sink_mode == GLITE_LB_SINK_PARSE) glite_wll_perftest_consumeEventIlMsg(buf);
else
edg_wlc_JobId **jobs,
edg_wll_JobStat **states)
{
- char *userid = strmd5(ctx->peerName,NULL),*stmt = NULL,
+ char *userid, *stmt = NULL,
*res = NULL;
+/* TODO: merge */
+<<<<<<< userjobs.c
int njobs = 0,ret,i,j;
+=======
+ char *can_peername;
+ int njobs = 0,ret,i;
+>>>>>>> 1.2.30.3
edg_wlc_JobId *out = NULL;
glite_lbu_Statement sth = NULL;
edg_wll_ErrorCode err = 0;
edg_wll_ResetError(ctx);
+
+ if (!ctx->peerName) {
+ return edg_wll_SetError(ctx,EPERM, "user not authenticated (edg_wll_UserJobs)");
+ }
+ can_peername = edg_wll_gss_normalize_subj(ctx->peerName, 0);
+ userid = strmd5(can_peername,NULL);
+ free(can_peername);
trio_asprintf(&stmt,"select cert_subj from users where userid = '%|Ss'",userid);
case 0: edg_wll_SetError(ctx,ENOENT,ctx->peerName);
case -1: goto err;
default:
+/* TODO: merge */
+<<<<<<< userjobs.c
if (edg_wll_FetchRow(ctx,sth,1,NULL,&res) < 0) goto err;
if (strcmp(ctx->peerName,res)) {
+=======
+ if (edg_wll_FetchRow(sth,&res) < 0) goto err;
+ if (!edg_wll_gss_equal_subj(ctx->peerName,res)) {
+>>>>>>> 1.2.30.3
edg_wll_SetError(ctx,EDG_WLL_ERROR_MD5_CLASH,ctx->peerName);
goto err;
}
! h = js->${usuc};
! for (i=1; i<EDG_WLL_NUMBER_OF_STATCODES; i++) {
! edg_wll_JobStatCodeToSoap(i,&GLITE_SECURITY_GSOAP_LIST_GET(h, i-1)->state);
-! GLITE_SECURITY_GSOAP_LIST_GET(h, i-1)->$fmap{$_} = src->$_\[i];
+! GLITE_SECURITY_GSOAP_LIST_GET(h, i-1)->$fmap{$_} = src->$_\[i+1];
! }
! }
! else {
{
int i;
- assert(in); assert(out);
+ assert(out);
*out = 0;
- for ( i = 0; i < in->__sizeflag; i++ ) switch ( in->flag[i] )
+ if (in) for ( i = 0; i < in->__sizeflag; i++ ) switch ( in->flag[i] )
{
case CLASSADS: *out |= EDG_WLL_STAT_CLASSADS; break;
case CHILDREN: *out |= EDG_WLL_STAT_CHILDREN; break;
#include <glite/lb/query_rec.h>
#include <glite/lb/context-int.h>
+#define NO_GACL
+#include "lb_authz.h"
#include "get_events.h"
using namespace std;
int glite_lbu_bufferedInsertClose(glite_lbu_bufInsert bi) { return 0; }
int glite_lbu_QueryIndices(glite_lbu_DBContext ctx, const char *table, char ***key_names, char ****column_names) { return 0; }
int glite_lbu_DBError(glite_lbu_DBContext ctx, char **s1, char **s2) { return 0; }
+
+int edg_wll_JobStatus(
+ edg_wll_Context ctx,
+ const edg_wlc_JobId job,
+ int flags,
+ edg_wll_JobStat *stat)
+{
+ return 0;
+}
+
+int edg_wll_GetACL(edg_wll_Context ctx, edg_wlc_JobId jobid, edg_wll_Acl *acl) { return 0; }
+int edg_wll_CheckACL(edg_wll_Context ctx, edg_wll_Acl acl, int requested_perm) { return 0; }
+void edg_wll_FreeAcl(edg_wll_Acl acl) { return; }
}
CPPUNIT_TEST_SUITE_REGISTRATION(QueryEventsTest);