int convert_event_head(edg_wll_Context,char **,edg_wll_Event *);
int check_strict_jobid(edg_wll_Context, glite_jobid_const_t);
int match_status(edg_wll_Context, const edg_wll_JobStat *stat,const edg_wll_QueryRec **conditions);
+int check_job_query_index(edg_wll_Context, const edg_wll_QueryRec **);
#define NOTIF_ALL_JOBS "all_jobs"
static int check_event_query_index(edg_wll_Context,const edg_wll_QueryRec **,const edg_wll_QueryRec **);
-static int check_job_query_index(edg_wll_Context, const edg_wll_QueryRec **);
static char *jc_to_head_where(edg_wll_Context, const edg_wll_QueryRec **, int *);
static char *ec_to_head_where(edg_wll_Context, const edg_wll_QueryRec **);
static int match_flesh_conditions(const edg_wll_Event *,const edg_wll_QueryRec **);
is_all_query(jc) ? "\"-all\" queries denied by server configuration" : NULL);
}
-static int check_job_query_index(edg_wll_Context ctx, const edg_wll_QueryRec **jc)
+int check_job_query_index(edg_wll_Context ctx, const edg_wll_QueryRec **jc)
{
int i, j, jj;
#include "jobstat.h"
#include "db_supp.h"
+#include "query.h"
int edg_wll_UserJobsServer(
edg_wll_Context ctx,
free(res); res = NULL;
}
- if (states) *states = calloc(njobs+1, sizeof(**states));
- idx = 0;
- for (i = 0; i < njobs; i++) {
- if (edg_wll_JobStatusServer(ctx, out[idx], -1, &(*states)[idx]) != 0) {
- if (edg_wll_Error(ctx, NULL, NULL) == ENOENT) {
- /* some jobs may be purged meanwhile, ignore */
- continue;
+ if (states) {
+ edg_wll_QueryRec oc[2],*ocp[2] = { oc, NULL };
+
+ oc[0].attr = EDG_WLL_QUERY_ATTR_OWNER;
+ oc[1].attr = EDG_WLL_QUERY_ATTR_UNDEF;
+
+ if (check_job_query_index(ctx,ocp)) {
+ edg_wll_ResetError(ctx);
+ *states = NULL;
+ goto err;
+ }
+
+ *states = calloc(njobs+1, sizeof(**states));
+ idx = 0;
+ for (i = 0; i < njobs; i++) {
+ if (edg_wll_JobStatusServer(ctx, out[idx], -1, &(*states)[idx]) != 0) {
+ if (edg_wll_Error(ctx, NULL, NULL) == ENOENT) {
+ /* some jobs may be purged meanwhile, ignore */
+ continue;
+ }
+ else break;
}
- else break;
+ idx++;
}
- idx++;
}
err:
free(res);