From bf58f9597c86e12d965bbc4a051688ae8349c6ad Mon Sep 17 00:00:00 2001 From: =?utf8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= Date: Thu, 13 Jan 2011 16:19:24 +0000 Subject: [PATCH] Format strings fixes: - using gcc attribute to check arguments of glite_common_log() - possible security problems (use glite_common_log_msg() for simple strings) - other printf/glite_common_log arguments warnings --- org.glite.lb.common/src/il_log.c | 2 +- org.glite.lb.logger/src/event_queue.c | 2 +- org.glite.lb.logger/src/event_store.c | 10 +++--- org.glite.lb.logger/src/il_master.c | 2 +- org.glite.lb.logger/src/logd.c | 3 +- org.glite.lb.logger/src/logd_proto.c | 6 ++-- org.glite.lb.logger/src/queue_thread.c | 2 +- org.glite.lb.logger/src/send_event.c | 2 +- org.glite.lb.server/src/bkserverd.c | 4 +-- org.glite.lb.server/src/db_calls.c | 4 +-- org.glite.lb.server/src/dump.c | 2 +- org.glite.lb.server/src/get_events.c.T | 6 ++-- org.glite.lb.server/src/jobstat.c | 26 ++++++++-------- org.glite.lb.server/src/lb_authz.c | 14 ++++----- org.glite.lb.server/src/lb_proto.c | 4 +-- org.glite.lb.server/src/load.c | 2 +- org.glite.lb.server/src/notif_match.c | 6 ++-- org.glite.lb.server/src/notification.c | 32 +++++++++---------- org.glite.lb.server/src/query.c | 6 ++-- org.glite.lb.server/src/seqcode.c | 2 +- org.glite.lb.server/src/server_state.c | 6 ++-- org.glite.lb.server/src/srv_purge.c | 26 ++++++++-------- org.glite.lb.server/src/stats.c | 4 +-- org.glite.lb.server/src/store.c.T | 38 +++++++++++------------ org.glite.lb.server/src/stored_master.c | 2 +- org.glite.lb.server/src/userjobs.c | 4 +-- org.glite.lbjp-common.db/src/db-mysql.c | 4 +-- org.glite.lbjp-common.db/src/db-pg.c | 6 ++-- org.glite.lbjp-common.db/src/db.c | 2 +- org.glite.lbjp-common.log/src/log.c | 2 +- org.glite.lbjp-common.log/src/log.h | 2 +- org.glite.lbjp-common.server-bones/src/srvbones.c | 4 +-- 32 files changed, 118 insertions(+), 119 deletions(-) diff --git a/org.glite.lb.common/src/il_log.c b/org.glite.lb.common/src/il_log.c index 1986023..bdf600e 100644 --- a/org.glite.lb.common/src/il_log.c +++ b/org.glite.lb.common/src/il_log.c @@ -37,7 +37,7 @@ il_log(int level, char *fmt, ...) if(level <= log_level) { fprintf(stderr, "[%6ld] ", (long) pthread_self()); - fprintf(stderr, err_text); + fprintf(stderr, "%s", err_text); } if(level <= LOG_ERR) { diff --git a/org.glite.lb.logger/src/event_queue.c b/org.glite.lb.logger/src/event_queue.c index 8fc1e45..2e0815b 100644 --- a/org.glite.lb.logger/src/event_queue.c +++ b/org.glite.lb.logger/src/event_queue.c @@ -353,7 +353,7 @@ event_queue_move_events(struct event_queue *eq_s, while(p) { if((*cmp_func)(p->msg, data)) { glite_common_log(IL_LOG_CATEGORY, LOG_PRIORITY_DEBUG, - " moving event at offset %d(%d) from %s:%d to %s:%d", + " moving event at offset %ld(%d) from %s:%d to %s:%d", p->msg->offset, p->msg->generation, eq_s->dest_name, eq_s->dest_port, eq_d ? eq_d->dest_name : "trash", eq_d ? eq_d->dest_port : -1); /* il_log(LOG_DEBUG, " current: %x, next: %x\n", p, p->prev); */ diff --git a/org.glite.lb.logger/src/event_store.c b/org.glite.lb.logger/src/event_store.c index 1824899..8c4d00f 100644 --- a/org.glite.lb.logger/src/event_store.c +++ b/org.glite.lb.logger/src/event_store.c @@ -649,9 +649,9 @@ event_store_recover(struct event_store *es) glite_common_log(IL_LOG_CATEGORY, LOG_PRIORITY_DEBUG, " setting starting file position to %ld", last); glite_common_log(IL_LOG_CATEGORY, LOG_PRIORITY_DEBUG, - " bytes sent to logging server: %d", es->last_committed_ls); + " bytes sent to logging server: %ld", es->last_committed_ls); glite_common_log(IL_LOG_CATEGORY, LOG_PRIORITY_DEBUG, - " bytes sent to bookkeeping server: %d", es->last_committed_bs); + " bytes sent to bookkeeping server: %ld", es->last_committed_bs); if(last > 0) { int c; @@ -996,9 +996,9 @@ event_store_clean(struct event_store *es) glite_common_log(IL_LOG_CATEGORY, LOG_PRIORITY_DEBUG, " trying to cleanup event store %s", es->job_id_s); glite_common_log(IL_LOG_CATEGORY, LOG_PRIORITY_DEBUG, - " bytes sent to logging server: %d", es->last_committed_ls); + " bytes sent to logging server: %ld", es->last_committed_ls); glite_common_log(IL_LOG_CATEGORY, LOG_PRIORITY_DEBUG, - " bytes sent to bookkeeping server: %d", es->last_committed_bs); + " bytes sent to bookkeeping server: %ld", es->last_committed_bs); /* preliminary check to avoid opening event file */ /* if the positions differ, some events still have to be sent */ @@ -1063,7 +1063,7 @@ event_store_clean(struct event_store *es) last = ftell(ef); glite_common_log(IL_LOG_CATEGORY, LOG_PRIORITY_DEBUG, - " total bytes in file: %d", last); + " total bytes in file: %ld", last); if(es->last_committed_ls < last) { fclose(ef); diff --git a/org.glite.lb.logger/src/il_master.c b/org.glite.lb.logger/src/il_master.c index 2cc1018..c6a9248 100644 --- a/org.glite.lb.logger/src/il_master.c +++ b/org.glite.lb.logger/src/il_master.c @@ -333,7 +333,7 @@ handle_msg(il_octet_string_t *event, long offset) if((msg = server_msg_create(event, offset)) == NULL) { glite_common_log(IL_LOG_CATEGORY, LOG_PRIORITY_WARN, " handle_msg: error parsing event '%s': %s", - event, error_get_msg()); + event->data, error_get_msg()); return(0); } diff --git a/org.glite.lb.logger/src/logd.c b/org.glite.lb.logger/src/logd.c index d2aaf76..e93c577 100644 --- a/org.glite.lb.logger/src/logd.c +++ b/org.glite.lb.logger/src/logd.c @@ -561,8 +561,7 @@ This is LocalLogger, part of Workload Management System in EU DataGrid & EGEE.\n if (childpid == 0) { ret = doit(client_fd,cred,prefix,noIPC,noParse); if (client_fd) close(client_fd); - glite_common_log(LOG_CATEGORY_CONTROL,LOG_PRIORITY_DEBUG,"Exiting.\n", - CONNECTION_TIMEOUT); + glite_common_log(LOG_CATEGORY_CONTROL,LOG_PRIORITY_DEBUG,"Exiting.\n"); exit(0); } if (childpid > 0) { diff --git a/org.glite.lb.logger/src/logd_proto.c b/org.glite.lb.logger/src/logd_proto.c index 3e766d6..9ef2793 100644 --- a/org.glite.lb.logger/src/logd_proto.c +++ b/org.glite.lb.logger/src/logd_proto.c @@ -97,7 +97,7 @@ static int handle_gss_failures(int code, edg_wll_GssStatus *gss_code, const char break; } default: - glite_common_log(LOG_CATEGORY_SECURITY,LOG_PRIORITY_ERROR,"%s: %s, unknown error occured\n"); + glite_common_log(LOG_CATEGORY_SECURITY,LOG_PRIORITY_ERROR,"%s: %s, unknown error occured\n", func, text); break; } return ret; @@ -381,7 +381,7 @@ int edg_wll_log_proto_server(edg_wll_GssConnection *con, struct timeval *timeout } } if (!unique) { - glite_common_log(LOG_CATEGORY_ACCESS,LOG_PRIORITY_ERROR,"Cannot determine the unique long local-logger id (LLLID)!\n",lllid); + glite_common_log(LOG_CATEGORY_ACCESS,LOG_PRIORITY_ERROR,"Cannot determine the unique long local-logger id (LLLID %ld)!\n",lllid); return EAGAIN; } glite_common_log(LOG_CATEGORY_ACCESS,LOG_PRIORITY_INFO,"Long local-logger id (LLLID): %ld ... [ok]\n",lllid); @@ -598,7 +598,7 @@ int edg_wll_log_proto_server(edg_wll_GssConnection *con, struct timeval *timeout goto edg_wll_log_proto_server_end_1; } else glite_common_log(LOG_CATEGORY_ACCESS,LOG_PRIORITY_DEBUG, "Sending via IPC (UNIX socket \"%s\")\n\t" - "the message position %ld (%d bytes)... [ok]", + "the message position %ld (%ld bytes)... [ok]", socket_path, filepos, sizeof(filepos)); if (event->any.priority & (EDG_WLL_LOGFLAG_SYNC|EDG_WLL_LOGFLAG_SYNC_COMPAT)) { diff --git a/org.glite.lb.logger/src/queue_thread.c b/org.glite.lb.logger/src/queue_thread.c index ebcb820..e15a35f 100644 --- a/org.glite.lb.logger/src/queue_thread.c +++ b/org.glite.lb.logger/src/queue_thread.c @@ -31,7 +31,7 @@ queue_thread_cleanup(void *q) { struct event_queue *eq = (struct event_queue *)q; - glite_common_log(LOG_CATEGORY_CONTROL, LOG_PRIORITY_WARN, "thread %d exits", eq->thread_id); + glite_common_log(LOG_CATEGORY_CONTROL, LOG_PRIORITY_WARN, "thread %p exits", eq->thread_id); /* unlock all held locks */ /* FIXME: check that the thread always exits when holding these locks; diff --git a/org.glite.lb.logger/src/send_event.c b/org.glite.lb.logger/src/send_event.c index b48ab23..c1e797a 100644 --- a/org.glite.lb.logger/src/send_event.c +++ b/org.glite.lb.logger/src/send_event.c @@ -298,7 +298,7 @@ event_queue_send(struct event_queue *eq) return(-1); glite_common_log(IL_LOG_CATEGORY, LOG_PRIORITY_DEBUG, - " trying to deliver event at offset %d for job %s", + " trying to deliver event at offset %ld for job %s", msg->offset, msg->job_id_s); #ifdef LB_PERF diff --git a/org.glite.lb.server/src/bkserverd.c b/org.glite.lb.server/src/bkserverd.c index 2f50e09..88fb67c 100644 --- a/org.glite.lb.server/src/bkserverd.c +++ b/org.glite.lb.server/src/bkserverd.c @@ -477,7 +477,7 @@ int main(int argc, char *argv[]) case 'i': strcpy(pidfile,optarg); pidfile_forced = 1; break; case 'R': add_root(ctx, optarg, ADMIN_ACCESS); break; case 'F': glite_common_log(LOG_CATEGORY_CONTROL, LOG_PRIORITY_FATAL, - "%s: Option --super-users-file is deprecated, specify policy using --policy instead"); + "%s: Option --super-users-file is deprecated, specify policy using --policy instead", argv[0]); return 1; case 'x': noIndex = atoi(optarg); if (noIndex < 0 || noIndex > 2) { usage(name); return 1; } @@ -1061,7 +1061,7 @@ int bk_handle_connection(int conn, struct timeval *timeout, void *data) edg_wll_gss_release_cred(&mycred, NULL); mycred = newcred; } else { - glite_common_log(LOG_CATEGORY_SECURITY, LOG_PRIORITY_WARN, "[%d] reloading credentials failed, using old ones"); + glite_common_log(LOG_CATEGORY_SECURITY, LOG_PRIORITY_WARN, "[%d] reloading credentials failed, using old ones", getpid()); } break; case -1: diff --git a/org.glite.lb.server/src/db_calls.c b/org.glite.lb.server/src/db_calls.c index 0f47539..fce548e 100644 --- a/org.glite.lb.server/src/db_calls.c +++ b/org.glite.lb.server/src/db_calls.c @@ -44,7 +44,7 @@ int edg_wll_jobMembership(edg_wll_Context ctx, glite_jobid_const_t job) dbjob = edg_wlc_JobIdGetUnique(job); trio_asprintf(&stmt,"select proxy,server from jobs where jobid = '%|Ss' for update",dbjob); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); ret = edg_wll_ExecSQL(ctx,stmt,&q); if (ret <= 0) { if (ret == 0) { @@ -93,7 +93,7 @@ int edg_wll_LockJobRow(edg_wll_Context ctx, const char *job, int lock_mode) else trio_asprintf(&stmt, "select * from jobs where jobid='%|Ss' lock in share mode", job); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if ((nr = edg_wll_ExecSQL(ctx,stmt,&sh)) < 0) goto cleanup; if (nr == 0) { char *err; diff --git a/org.glite.lb.server/src/dump.c b/org.glite.lb.server/src/dump.c index 34ae9e4..ff785bd 100644 --- a/org.glite.lb.server/src/dump.c +++ b/org.glite.lb.server/src/dump.c @@ -85,7 +85,7 @@ int edg_wll_DumpEventsServer(edg_wll_Context ctx,const edg_wll_DumpRequest *req, "order by arrived", ctx->srvName,ctx->srvPort, from_s,to_s); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if (edg_wll_ExecSQL(ctx,stmt,&q) < 0) goto clean; diff --git a/org.glite.lb.server/src/get_events.c.T b/org.glite.lb.server/src/get_events.c.T index 3f51578..4ff6ca5 100644 --- a/org.glite.lb.server/src/get_events.c.T +++ b/org.glite.lb.server/src/get_events.c.T @@ -56,7 +56,7 @@ int edg_wll_get_event_flesh(edg_wll_Context ctx,int n,edg_wll_Event *e) edg_wll_ResetError(ctx); trio_asprintf(&q, "select ulm from events_flesh where jobid = '%|Ss' and event = %d", jobid, n); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); if ((ret=edg_wll_ExecSQL(ctx,q,&sh)) < 0) goto cleanup; if (edg_wll_FetchRow(ctx,sh,1,NULL,&nameval[0]) == 1) { @@ -81,8 +81,8 @@ int edg_wll_get_event_flesh(edg_wll_Context ctx,int n,edg_wll_Event *e) trio_asprintf(&q,"select name,value from %s " "where jobid = '%|Ss' and event = %d ", tables[t],jobid,n); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, - q); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, + LOG_PRIORITY_DEBUG, q); if ((ret=edg_wll_ExecSQL(ctx,q,&sh)) < 0) goto cleanup; diff --git a/org.glite.lb.server/src/jobstat.c b/org.glite.lb.server/src/jobstat.c index fa75a56..67fe561 100644 --- a/org.glite.lb.server/src/jobstat.c +++ b/org.glite.lb.server/src/jobstat.c @@ -210,7 +210,7 @@ int edg_wll_JobStatusServer( trio_asprintf(&stmt, "SELECT version,int_status,jobid FROM states WHERE parent_job='%|Ss'", md5_jobid); if (stmt != NULL) { - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); num_sub = edg_wll_ExecSQL(ctx, stmt, &sh); if (num_sub >=0 ) { i = 0; @@ -298,7 +298,7 @@ int edg_wll_JobStatusServer( // Get child states from the database trio_asprintf(&stmt, "SELECT version,status,jobid FROM states WHERE parent_job='%|Ss'", md5_jobid); if (stmt != NULL) { - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); num_sub = edg_wll_ExecSQL(ctx, stmt, &sh); if (num_sub >=0 ) { while ((num_f = edg_wll_FetchRow(ctx, sh, sizeof(out_stat)/sizeof(out_stat[0]), NULL, out_stat)) == 3 ) { @@ -379,7 +379,7 @@ int edg_wll_JobStatusServer( "WHERE s.parent_job='%|Ss' AND s.jobid=j.jobid", md5_jobid); if (stmt != NULL) { - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); num_sub = edg_wll_ExecSQL(ctx, stmt, &sh); if (num_sub >=0 ) { while ((num_f = edg_wll_FetchRow(ctx, sh, sizeof(out)/sizeof(out[0]), NULL, out)) == 1 ) { @@ -674,7 +674,7 @@ static char *job_owner(edg_wll_Context ctx,char *md5_jobid) edg_wll_SetError(ctx,ENOMEM, NULL); return NULL; } - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if (edg_wll_ExecSQL(ctx,stmt,&sh) >= 0) { f=edg_wll_FetchRow(ctx,sh,1,NULL,&out); if (f == 0) { @@ -706,7 +706,7 @@ static edg_wll_ErrorCode get_job_parent(edg_wll_Context ctx, glite_jobid_const_t edg_wll_SetError(ctx,ENOMEM, NULL); goto err; } - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if (edg_wll_ExecSQL(ctx,stmt,&sh) < 0) goto err; @@ -823,7 +823,7 @@ edg_wll_ErrorCode edg_wll_StoreIntState(edg_wll_Context ctx, "(jobid,seq,name,value) values " "('%|Ss',%d,'%|Ss','%|Ss')", jobid_md5, seq, (*tagp).tag, (*tagp).value); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if (edg_wll_ExecSQL(ctx,stmt,NULL) < 0) { @@ -857,7 +857,7 @@ edg_wll_ErrorCode edg_wll_StoreIntState(edg_wll_Context ctx, parent_md5, icvalues, jobid_md5); free(icvalues); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if ((dbret = edg_wll_ExecSQL(ctx,stmt,NULL)) < 0) goto cleanup; free(stmt); stmt = NULL; @@ -874,7 +874,7 @@ edg_wll_ErrorCode edg_wll_StoreIntState(edg_wll_Context ctx, INTSTAT_VERSION, parent_md5, icvalues); free(icnames); free(icvalues); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if (edg_wll_ExecSQL(ctx,stmt,NULL) < 0) goto cleanup; free(stmt); stmt = NULL; @@ -890,7 +890,7 @@ edg_wll_ErrorCode edg_wll_StoreIntState(edg_wll_Context ctx, if (update) { trio_asprintf(&stmt, "delete from status_tags " "where jobid ='%|Ss' and seq<%d", jobid_md5, seq); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if (edg_wll_ExecSQL(ctx,stmt,NULL) < 0) goto cleanup; free(stmt); stmt = NULL; @@ -921,7 +921,7 @@ edg_wll_ErrorCode edg_wll_StoreIntStateEmbryonic(edg_wll_Context ctx, ",parent_job%s) " "values (%s)", icnames, values); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if (edg_wll_ExecSQL(ctx,stmt,NULL) < 0) goto cleanup; @@ -971,7 +971,7 @@ edg_wll_ErrorCode edg_wll_LoadIntState(edg_wll_Context ctx, if (stmt == NULL) { return edg_wll_SetError(ctx, ENOMEM, NULL); } - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if ((nstates = edg_wll_ExecSQL(ctx,stmt,&sh)) < 0) goto cleanup; if (nstates == 0) { @@ -1338,7 +1338,7 @@ edg_wll_ErrorCode edg_wll_GetSubjobHistogram(edg_wll_Context ctx, glite_jobid_co if (stmt==NULL) { return edg_wll_SetError(ctx,ENOMEM, NULL); } - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if (edg_wll_ExecSQL(ctx,stmt,&sh) >= 0) { f=edg_wll_FetchRow(ctx,sh,1,NULL,&out); @@ -1390,7 +1390,7 @@ edg_wll_ErrorCode edg_wll_StoreSubjobHistogram(edg_wll_Context ctx, glite_jobid_ } //printf ("\n\n\n Would like to run SQL statament: %s\n\n\n\n", stmt); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if ((dbret = edg_wll_ExecSQL(ctx,stmt,NULL)) < 0) goto cleanup; diff --git a/org.glite.lb.server/src/lb_authz.c b/org.glite.lb.server/src/lb_authz.c index 83c5b47..6a786e0 100644 --- a/org.glite.lb.server/src/lb_authz.c +++ b/org.glite.lb.server/src/lb_authz.c @@ -666,7 +666,7 @@ edg_wll_HandleCounterACL(edg_wll_Context ctx, edg_wll_Acl acl, for ( ; ; ) { - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q1); if ( edg_wll_ExecSQL(ctx, q1, NULL) > 0 ) goto end; @@ -682,7 +682,7 @@ edg_wll_HandleCounterACL(edg_wll_Context ctx, edg_wll_Acl acl, "update acls set refcnt = refcnt+%d " "where aclid = '%|Ss'", incr, aclid); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q2); if ( edg_wll_ExecSQL(ctx, q2, NULL) < 0 ) continue; @@ -697,7 +697,7 @@ edg_wll_HandleCounterACL(edg_wll_Context ctx, edg_wll_Acl acl, "where aclid='%|Ss' and refcnt>=%d", -incr, aclid, -incr); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q1); if ( edg_wll_ExecSQL(ctx, q1, NULL) > 0 ) { @@ -705,7 +705,7 @@ edg_wll_HandleCounterACL(edg_wll_Context ctx, edg_wll_Acl acl, "delete from acls " "where aclid='%|Ss' and refcnt=0", aclid); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q2); edg_wll_ExecSQL(ctx, q2, NULL); } @@ -787,7 +787,7 @@ edg_wll_UpdateACL(edg_wll_Context ctx, glite_jobid_const_t job, trio_asprintf(&stmt, "update jobs set aclid='%|Ss' where jobid='%|Ss' and ISNULL(aclid)", new_aclid, md5_jobid); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); updated = edg_wll_ExecSQL(ctx, stmt, NULL); free(stmt); stmt = NULL; @@ -833,7 +833,7 @@ int edg_wll_GetACL(edg_wll_Context ctx, glite_jobid_const_t jobid, edg_wll_Acl * trio_asprintf(&q, "select aclid from jobs where jobid = '%|Ss'", jobstr); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); if (edg_wll_ExecSQL(ctx, q, &stmt) < 0 || edg_wll_FetchRow(ctx, stmt, 1, NULL, &acl_id) < 0) { @@ -851,7 +851,7 @@ int edg_wll_GetACL(edg_wll_Context ctx, glite_jobid_const_t jobid, edg_wll_Acl * trio_asprintf(&q, "select value from acls where aclid = '%|Ss'", acl_id); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); if (edg_wll_ExecSQL(ctx, q, &stmt) < 0 || edg_wll_FetchRow(ctx, stmt, 1, NULL, &acl_str) < 0) { diff --git a/org.glite.lb.server/src/lb_proto.c b/org.glite.lb.server/src/lb_proto.c index 8dc453a..039b4f8 100644 --- a/org.glite.lb.server/src/lb_proto.c +++ b/org.glite.lb.server/src/lb_proto.c @@ -231,7 +231,7 @@ static int getUserNotifications(edg_wll_Context ctx, char *user, char ***notifid "from notif_registrations " "where userid='%s'", user); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); if (edg_wll_ExecSQL(ctx, q, ¬ifs) < 0) goto err; free(q); q = NULL; @@ -263,7 +263,7 @@ static int getNotifInfo(edg_wll_Context ctx, char *notifId, notifInfo *ni){ "from notif_registrations " "where notifid='%s'", notifId); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); if (edg_wll_ExecSQL(ctx, q, ¬if) < 0) goto err; free(q); q = NULL; diff --git a/org.glite.lb.server/src/load.c b/org.glite.lb.server/src/load.c index e1d5ca1..19ad4e5 100644 --- a/org.glite.lb.server/src/load.c +++ b/org.glite.lb.server/src/load.c @@ -87,7 +87,7 @@ int edg_wll_LoadEventsServer(edg_wll_Context ctx,const edg_wll_LoadRequest *req, sprintf(errs, "Error parsing event at line %d", i); if ( !edg_wll_Error(ctx,NULL,NULL) ) edg_wll_SetError(ctx, EINVAL, errs); - fprintf(stderr, errs); + fprintf(stderr, "%s", errs); continue; } edg_wll_ULMDateToTimeval(buff, &(event->any.arrived)); diff --git a/org.glite.lb.server/src/notif_match.c b/org.glite.lb.server/src/notif_match.c index a8fe6fa..f715f4f 100644 --- a/org.glite.lb.server/src/notif_match.c +++ b/org.glite.lb.server/src/notif_match.c @@ -106,7 +106,7 @@ int edg_wll_NotifMatch(edg_wll_Context ctx, const edg_wll_JobStat *oldstat, cons ju = edg_wlc_JobIdGetUnique(stat->jobId),NOTIF_ALL_JOBS,cond_where ? cond_where : "",cond_and_where ? cond_and_where : ""); free(ju); ju = NULL; - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, jobq); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, jobq); if (edg_wll_ExecSQL(ctx,jobq,&jobs) < 0) goto err; @@ -172,8 +172,8 @@ int edg_wll_NotifExpired(edg_wll_Context ctx,const char *notif) trio_asprintf(&dn,"delete from notif_registrations where notifid='%|Ss'",notif); trio_asprintf(&dj,"delete from notif_jobs where notifid='%|Ss'",notif); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, dn); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, dj); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, dn); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, dj); if (edg_wll_ExecSQL(ctx,dn,NULL) < 0 || edg_wll_ExecSQL(ctx,dj,NULL) < 0) diff --git a/org.glite.lb.server/src/notification.c b/org.glite.lb.server/src/notification.c index b20b263..2c35977 100644 --- a/org.glite.lb.server/src/notification.c +++ b/org.glite.lb.server/src/notification.c @@ -140,7 +140,7 @@ int edg_wll_NotifNewServer( "values ('%|Ss','%|Ss',%s,'%|Ss', '%|Ss', '%d')", nid_s, addr_s? addr_s: address_override, time_s, owner, xml_conds, flags); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); if ( edg_wll_ExecSQL(ctx, q, NULL) < 0 ) goto rollback; @@ -156,7 +156,7 @@ int edg_wll_NotifNewServer( trio_asprintf(&q, "insert into notif_jobs(notifid,jobid) values ('%|Ss','%|Ss')", nid_s, jobs[i]); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); if ( edg_wll_ExecSQL(ctx, q, NULL) < 0 ) goto rollback; @@ -164,7 +164,7 @@ int edg_wll_NotifNewServer( else { trio_asprintf(&q,"insert into notif_jobs(notifid,jobid) values ('%|Ss','%|Ss')", nid_s,NOTIF_ALL_JOBS); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); if ( edg_wll_ExecSQL(ctx, q, NULL) < 0 ) goto rollback; @@ -330,7 +330,7 @@ int edg_wll_NotifChangeServer( /* Format DB insert statement */ trio_asprintf(&q, "delete from notif_jobs where notifid='%|Ss'", nid_s); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); if ( edg_wll_ExecSQL(ctx, q, NULL) < 0 ) goto rollback; @@ -341,7 +341,7 @@ int edg_wll_NotifChangeServer( trio_asprintf(&q, "insert into notif_jobs(notifid,jobid) values ('%|Ss','%|Ss')", nid_s, jobs[i]); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); if ( edg_wll_ExecSQL(ctx, q, NULL) < 0 ) { /* XXX: Remove uncoplete registration? @@ -349,11 +349,11 @@ int edg_wll_NotifChangeServer( */ free(q); trio_asprintf(&q, "delete from notif_jobs where notifid='%|Ss'", nid_s); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); edg_wll_ExecSQL(ctx, q, NULL); free(q); trio_asprintf(&q,"delete from notif_registrations where notifid='%|Ss'", nid_s); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); edg_wll_ExecSQL(ctx, q, NULL); goto rollback; } @@ -467,7 +467,7 @@ static char *get_user(edg_wll_Context ctx, int create) } can_peername = edg_wll_gss_normalize_subj(ctx->peerName, 0); trio_asprintf(&q, "select userid from users where cert_subj='%|Ss'", can_peername); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); if ( edg_wll_ExecSQL(ctx, q, &stmt) < 0 ) goto cleanup; @@ -487,7 +487,7 @@ static char *get_user(edg_wll_Context ctx, int create) free(q); trio_asprintf(&q, "insert into users(userid,cert_subj) values ('%|Ss','%|Ss')", userid, can_peername); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); if ( edg_wll_ExecSQL(ctx, q, NULL) < 0 ) { if ( edg_wll_Error(ctx,NULL,NULL) != EEXIST ) @@ -536,7 +536,7 @@ static int check_notif_request( "select destination from notif_registrations " "where notifid='%|Ss' and userid='%|Ss' FOR UPDATE", nid_s, user); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if ( (ret = edg_wll_ExecSQL(ctx, stmt, &s)) < 0 ) goto cleanup; @@ -545,7 +545,7 @@ static int check_notif_request( free(stmt); trio_asprintf(&stmt, "select notifid from notif_registrations where notifid='%|Ss'", nid_s); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); ret = edg_wll_ExecSQL(ctx, stmt, NULL); if ( ret == 0 ) @@ -698,7 +698,7 @@ static int update_notif( trio_asprintf(&aux, "%s where notifid='%|Ss'", stmt, nid_s); free(stmt); stmt = aux; - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if ( (ret = edg_wll_ExecSQL(ctx, stmt, NULL)) < 0 ) goto cleanup; @@ -707,7 +707,7 @@ static int update_notif( free(stmt); trio_asprintf(&stmt, "select notifid from notif_registrations where notifid='%|Ss'", nid_s); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); ret = edg_wll_ExecSQL(ctx, stmt, NULL); if ( ret == 0 ) edg_wll_SetError(ctx, ENOENT, "Unknown notification ID"); @@ -818,12 +818,12 @@ static int drop_notif_request(edg_wll_Context ctx, const edg_wll_NotifId nid) { goto rollback; trio_asprintf(&stmt, "delete from notif_registrations where notifid='%|Ss'", nid_s); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if ( edg_wll_ExecSQL(ctx, stmt, NULL) < 0 ) goto rollback; free(stmt); trio_asprintf(&stmt, "delete from notif_jobs where notifid='%|Ss'", nid_s); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if ( edg_wll_ExecSQL(ctx, stmt, NULL) < 0 ) goto rollback; edg_wll_NotifCancelRegId(ctx, nid); @@ -869,7 +869,7 @@ static int check_notif_age(edg_wll_Context ctx, const edg_wll_NotifId nid) { } trio_asprintf(&q, "select notifid from notif_registrations WHERE notifid='%|Ss' AND valid < %s", nid_s, time_s); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); if ( (ret = edg_wll_ExecSQL(ctx, q, NULL)) < 0 ) goto cleanup; diff --git a/org.glite.lb.server/src/query.c b/org.glite.lb.server/src/query.c index 8664b24..0408582 100644 --- a/org.glite.lb.server/src/query.c +++ b/org.glite.lb.server/src/query.c @@ -161,7 +161,7 @@ int edg_wll_QueryEventsServer( else if ( !q ) q = qbase; - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); ret = edg_wll_ExecSQL(ctx, q, &sh); if ( limit ) @@ -436,7 +436,7 @@ int edg_wll_QueryJobsServer( else if ( !q ) q = qbase; - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); ret = edg_wll_ExecSQL(ctx, q, &sh); if ( limit ) @@ -570,7 +570,7 @@ limit_cycle_cleanup: "(s.suffix_id = j.suffix_id) AND (p.prefix_id = j.prefix_id)) AS result " "WHERE %s", zomb_where); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, zquery); j = edg_wll_ExecSQL(ctx,zquery,&sh); diff --git a/org.glite.lb.server/src/seqcode.c b/org.glite.lb.server/src/seqcode.c index 0ef16d6..d5d0c1a 100644 --- a/org.glite.lb.server/src/seqcode.c +++ b/org.glite.lb.server/src/seqcode.c @@ -54,7 +54,7 @@ int edg_wll_QuerySequenceCodeServer(edg_wll_Context ctx, edg_wlc_JobId jobid, co if ( stmt == NULL ) return edg_wll_SetError(ctx, ENOMEM, NULL); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if ( (nstates = edg_wll_ExecSQL(ctx, stmt, &sh)) < 0 ) goto cleanup; if ( nstates == 0 ) { diff --git a/org.glite.lb.server/src/server_state.c b/org.glite.lb.server/src/server_state.c index d61007d..a95610e 100644 --- a/org.glite.lb.server/src/server_state.c +++ b/org.glite.lb.server/src/server_state.c @@ -35,7 +35,7 @@ int edg_wll_GetServerState(edg_wll_Context ctx,const char *name,char **val) trio_asprintf(&stmt,"select value from server_state " "where prefix = 'https://%|Ss:%d' and name = '%|Ss'", ctx->srvName,ctx->srvPort,name); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); switch (edg_wll_ExecSQL(ctx,stmt,&q)) { case 0: edg_wll_SetError(ctx,ENOENT,name); break; @@ -55,7 +55,7 @@ int edg_wll_SetServerState(edg_wll_Context ctx,const char *name,const char *val) trio_asprintf(&stmt,"insert into server_state (prefix,name,value) " "values ('https://%|Ss:%d','%|Ss','%|Ss')", ctx->srvName,ctx->srvPort,name,val); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); switch(edg_wll_ExecSQL(ctx,stmt,NULL)) { case 1: break; @@ -65,7 +65,7 @@ int edg_wll_SetServerState(edg_wll_Context ctx,const char *name,const char *val) "where prefix = 'https://%|Ss:%d' " "and name = '%|Ss'", val,ctx->srvName,ctx->srvPort,name); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); edg_wll_ExecSQL(ctx,stmt,NULL); } diff --git a/org.glite.lb.server/src/srv_purge.c b/org.glite.lb.server/src/srv_purge.c index 5e1ce09..ee917e5 100644 --- a/org.glite.lb.server/src/srv_purge.c +++ b/org.glite.lb.server/src/srv_purge.c @@ -796,17 +796,17 @@ int purge_one(edg_wll_Context ctx,edg_wll_JobStat *stat,int dump, int purge, int if ( purge ) { trio_asprintf(&stmt,"delete from jobs where jobid = '%|Ss'",dbjob); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if (edg_wll_ExecSQL(ctx,stmt,NULL) < 0) goto rollback; free(stmt); stmt = NULL; trio_asprintf(&stmt,"delete from states where jobid = '%|Ss'",dbjob); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if (edg_wll_ExecSQL(ctx,stmt,NULL) < 0) goto rollback; free(stmt); stmt = NULL; trio_asprintf(&stmt,"delete from status_tags where jobid = '%|Ss'",dbjob); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if (edg_wll_ExecSQL(ctx,stmt,NULL) < 0) goto rollback; free(stmt); stmt = NULL; } @@ -817,7 +817,7 @@ int purge_one(edg_wll_Context ctx,edg_wll_JobStat *stat,int dump, int purge, int // See if that prefix is already stored in the database trio_asprintf(&stmt,"select prefix_id from zombie_prefixes where prefix = '%|Ss'", prefix); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); sql_retval = edg_wll_ExecSQL(ctx,stmt,&q); free(stmt); stmt = NULL; @@ -828,7 +828,7 @@ int purge_one(edg_wll_Context ctx,edg_wll_JobStat *stat,int dump, int purge, int glite_lbu_FreeStmt(&q); trio_asprintf(&stmt,"insert into zombie_prefixes (prefix) VALUES ('%|Ss')", prefix); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if (edg_wll_ExecSQL(ctx,stmt,&q) <= 0) goto rollback; @@ -837,7 +837,7 @@ int purge_one(edg_wll_Context ctx,edg_wll_JobStat *stat,int dump, int purge, int // The record should exist now, however we need to look up the prefix_id trio_asprintf(&stmt,"select prefix_id from zombie_prefixes where prefix = '%|Ss'", prefix); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if (edg_wll_ExecSQL(ctx,stmt,&q) <= 0) goto rollback; free(stmt); stmt = NULL; @@ -850,7 +850,7 @@ int purge_one(edg_wll_Context ctx,edg_wll_JobStat *stat,int dump, int purge, int // See if that suffix is already stored in the database trio_asprintf(&stmt,"select suffix_id from zombie_suffixes where suffix = '%|Ss'", suffix); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); sql_retval = edg_wll_ExecSQL(ctx,stmt,&q); free(stmt); stmt = NULL; @@ -861,7 +861,7 @@ int purge_one(edg_wll_Context ctx,edg_wll_JobStat *stat,int dump, int purge, int glite_lbu_FreeStmt(&q); trio_asprintf(&stmt,"insert into zombie_suffixes (suffix) VALUES ('%|Ss')", suffix); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if (edg_wll_ExecSQL(ctx,stmt,&q) <= 0) goto rollback; @@ -870,7 +870,7 @@ int purge_one(edg_wll_Context ctx,edg_wll_JobStat *stat,int dump, int purge, int // The record should exist now, however we need to look up the suffix_id trio_asprintf(&stmt,"select suffix_id from zombie_suffixes where suffix = '%|Ss'", suffix); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if (edg_wll_ExecSQL(ctx,stmt,&q) <= 0) goto rollback; free(stmt); stmt = NULL; @@ -883,7 +883,7 @@ int purge_one(edg_wll_Context ctx,edg_wll_JobStat *stat,int dump, int purge, int trio_asprintf(&stmt,"insert into zombie_jobs (jobid, prefix_id, suffix_id)" " VALUES ('%|Ss', '%|Ss', '%|Ss')", root, prefix_id, suffix_id); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if (edg_wll_ExecSQL(ctx,stmt,&q) < 0) { if (edg_wll_Error(ctx, NULL, NULL) == EEXIST) { @@ -927,7 +927,7 @@ int purge_one(edg_wll_Context ctx,edg_wll_JobStat *stat,int dump, int purge, int "where jobid='%|Ss' " "order by event", dbjob); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if (edg_wll_ExecSQL(ctx,stmt,&q) < 0) goto rollback; free(stmt); stmt = NULL; @@ -981,7 +981,7 @@ int unset_proxy_flag(edg_wll_Context ctx, glite_jobid_const_t job) dbjob = glite_jobid_getUnique(job); trio_asprintf(&stmt,"update jobs set proxy='0' where jobid='%|Ss'", dbjob); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); free(dbjob); return(edg_wll_ExecSQL(ctx,stmt,NULL)); @@ -997,7 +997,7 @@ int unset_server_flag(edg_wll_Context ctx, glite_jobid_const_t job) dbjob = glite_jobid_getUnique(job); trio_asprintf(&stmt,"update jobs set server='0' where jobid='%|Ss'", dbjob); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); free(dbjob); return(edg_wll_ExecSQL(ctx,stmt,NULL)); diff --git a/org.glite.lb.server/src/stats.c b/org.glite.lb.server/src/stats.c index ebe644a..3d3b3d6 100644 --- a/org.glite.lb.server/src/stats.c +++ b/org.glite.lb.server/src/stats.c @@ -689,7 +689,7 @@ static int stateRateRequest( *rate += c->cnt * (float)diff/i; if (*to >= afrom && *to < afrom+i) { - glite_common_log(LOG_CATEGORY_LB_SERVER, LOG_PRIORITY_DEBUG, "matched to: match %d, rate %f", match, *rate); + glite_common_log(LOG_CATEGORY_LB_SERVER, LOG_PRIORITY_DEBUG, "matched to: match %ld, rate %f", match, *rate); break; } } @@ -921,7 +921,7 @@ static int stateDurationFromToRequest( *dispersion += (float)diff * c->value2; if (*to >= afrom && *to < afrom+i) { - glite_common_log(LOG_CATEGORY_LB_SERVER, LOG_PRIORITY_DEBUG, "matched to: match %d, duration %f, dispersion %f", match, *duration, *dispersion); + glite_common_log(LOG_CATEGORY_LB_SERVER, LOG_PRIORITY_DEBUG, "matched to: match %ld, duration %f, dispersion %f", match, *duration, *dispersion); break; } } diff --git a/org.glite.lb.server/src/store.c.T b/org.glite.lb.server/src/store.c.T index cfbc7a5..8c3ea00 100644 --- a/org.glite.lb.server/src/store.c.T +++ b/org.glite.lb.server/src/store.c.T @@ -100,7 +100,7 @@ int edg_wll_StoreEvent(edg_wll_Context ctx,edg_wll_Event *e,const char *ulm,int } trio_asprintf(&stmt,"select userid from jobs where jobid='%|Ss'", jobid); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); 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); @@ -116,7 +116,7 @@ int edg_wll_StoreEvent(edg_wll_Context ctx,edg_wll_Event *e,const char *ulm,int ssrc,e->any.host, stamp,e->any.timestamp.tv_usec, e->any.level,userid, e->any.seqcode); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if (edg_wll_ExecSQL(ctx,stmt,&sh) < 0) goto clean; nr = edg_wll_FetchRow(ctx,sh,1,NULL,&dummy); @@ -138,7 +138,7 @@ int edg_wll_StoreEvent(edg_wll_Context ctx,edg_wll_Event *e,const char *ulm,int trio_asprintf(&stmt, "select nevents from jobs " "where jobid = '%|Ss'",jobid); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if (edg_wll_ExecSQL(ctx,stmt,&sh) < 0 || edg_wll_FetchRow(ctx,sh,1,NULL,&max) < 0) goto clean; @@ -158,7 +158,7 @@ int edg_wll_StoreEvent(edg_wll_Context ctx,edg_wll_Event *e,const char *ulm,int ssrc,e->any.host, stamp,e->any.timestamp.tv_usec, now_s, e->any.level,userid, e->any.seqcode); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if (edg_wll_ExecSQL(ctx,stmt,NULL) < 0) goto clean; free(stmt); stmt = NULL; @@ -167,7 +167,7 @@ int edg_wll_StoreEvent(edg_wll_Context ctx,edg_wll_Event *e,const char *ulm,int trio_asprintf(&stmt, "update jobs set nevents='%d'" "where jobid = '%|Ss'", next+1, jobid); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if (edg_wll_ExecSQL(ctx,stmt,NULL) < 0) goto clean; free(stmt); stmt = NULL; @@ -194,7 +194,7 @@ static int store_user(edg_wll_Context ctx,const char *userid,const char *subj) trio_asprintf(&stmt,"insert into users(userid,cert_subj) " "values ('%|Ss','%|Ss')",userid,subj); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if (edg_wll_ExecSQL(ctx,stmt,NULL) < 0) { if (edg_wll_Error(ctx,NULL,NULL) == EEXIST) @@ -244,7 +244,7 @@ static int store_job(edg_wll_Context ctx,glite_jobid_const_t job,const char *use trio_asprintf(&stmt,"insert into jobs(jobid,dg_jobid,userid,proxy,server,grey) " "values ('%|Ss','%|Ss','%|Ss', '%|Sd', '%|Sd', '%|Sd')",jobid,jobstr,userid,proxy,server,grey); } - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if (edg_wll_ExecSQL(ctx,stmt,NULL) < 0) { if (edg_wll_Error(ctx,NULL,NULL) == EEXIST && !update) @@ -297,7 +297,7 @@ int store_job_server_proxy(edg_wll_Context ctx, edg_wll_Event *event, int *regis trio_asprintf(&q,"select proxy,server,grey from jobs where jobid='%|Ss' for update", unique); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); nar = edg_wll_ExecSQL(ctx,q,&stmt); free(q); q = NULL; @@ -393,7 +393,7 @@ int store_job_server_proxy(edg_wll_Context ctx, edg_wll_Event *event, int *regis { trio_asprintf(&q,"select u.cert_subj from jobs j, users u " "where j.jobid='%|Ss' and u.userid=j.userid",unique); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); if (edg_wll_ExecSQL(ctx,q,&stmt) < 0 || edg_wll_FetchRow(ctx,stmt,1,NULL,&owner) < 0 @@ -415,7 +415,7 @@ int store_job_server_proxy(edg_wll_Context ctx, edg_wll_Event *event, int *regis if ( (!strcmp(res[0],"0") && ctx->isProxy) || (!strcmp(res[1],"0") && !ctx->isProxy) ) { trio_asprintf(&q,"update jobs set server='1', proxy='1' where jobid='%|Ss'", unique); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); if (edg_wll_ExecSQL(ctx,q,NULL) < 0) goto err; free(q); q = NULL; } @@ -508,7 +508,7 @@ static int store_flesh(edg_wll_Context ctx,edg_wll_Event *e,const char *ulm,char "values ('%|Ss',%d,'%|Ss','%|Ss')", strlen(f[i].val) <= SHORT_LEN ? "short_fields" : "long_fields", jobid,no,f[i].key,f[i].val); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if (edg_wll_ExecSQL(ctx,stmt,NULL) < 0) err = edg_wll_Error(ctx,NULL,NULL); free(stmt); @@ -520,7 +520,7 @@ static int store_flesh(edg_wll_Context ctx,edg_wll_Event *e,const char *ulm,char trio_asprintf(&stmt,"insert into short_fields(jobid,event,name,value) " "values ('%|Ss',%d,'SRC_INSTANCE','%|Ss')", jobid,no,e->any.src_instance); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if (edg_wll_ExecSQL(ctx,stmt,NULL) < 0) err = edg_wll_Error(ctx,NULL,NULL); free(stmt); @@ -528,7 +528,7 @@ static int store_flesh(edg_wll_Context ctx,edg_wll_Event *e,const char *ulm,char #else if (!ulm) ulm = edg_wll_UnparseEvent(ctx, e); trio_asprintf(&stmt, "insert into events_flesh (jobid, event, ulm) values ('%|Ss', %d, '%|Ss')", jobid, no, ulm); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if (edg_wll_ExecSQL(ctx,stmt,NULL) < 0) err = edg_wll_Error(ctx,NULL,NULL); #endif @@ -617,7 +617,7 @@ static int check_auth(edg_wll_Context ctx,edg_wll_Event *e) trio_asprintf(&q,"select u.cert_subj from jobs j, users u " "where j.jobid='%|Ss' and u.userid=j.userid",jobid); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, q); if (edg_wll_ExecSQL(ctx,q,&stmt) < 0 || edg_wll_FetchRow(ctx,stmt,1,NULL,&owner) < 0 @@ -751,7 +751,7 @@ int register_subjobs_embryonic(edg_wll_Context ctx,const edg_wll_RegJobEvent *e) /* get userid of parent job */ jobid = edg_wlc_JobIdGetUnique(e->jobId); trio_asprintf(&stmt,"select userid from jobs where jobid='%|Ss'", jobid); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); if (edg_wll_ExecSQL(ctx,stmt,&sh) < 0 || edg_wll_FetchRow(ctx,sh,1,NULL,&userid) < 0) goto err; @@ -817,7 +817,7 @@ int edg_wll_delete_event(edg_wll_Context ctx,const char *jobid,int event) trio_asprintf(&stmt, "delete from short_fields where jobid='%|Ss' and event=%d", jobid,event); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); edg_wll_ExecSQL(ctx,stmt,NULL); free(stmt); @@ -825,7 +825,7 @@ int edg_wll_delete_event(edg_wll_Context ctx,const char *jobid,int event) trio_asprintf(&stmt, "delete from long_fields where jobid='%|Ss' and event=%d", jobid,event); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); edg_wll_ExecSQL(ctx,stmt,NULL); free(stmt); @@ -833,7 +833,7 @@ int edg_wll_delete_event(edg_wll_Context ctx,const char *jobid,int event) trio_asprintf(&stmt, "delete from events_flesh where jobid='%|Ss' and event=%d", jobid,event); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); edg_wll_ExecSQL(ctx,stmt,NULL); free(stmt); @@ -841,7 +841,7 @@ int edg_wll_delete_event(edg_wll_Context ctx,const char *jobid,int event) trio_asprintf(&stmt, "delete from events where jobid='%|Ss' and event=%d", jobid,event); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); edg_wll_ExecSQL(ctx,stmt,NULL); free (stmt); diff --git a/org.glite.lb.server/src/stored_master.c b/org.glite.lb.server/src/stored_master.c index b265435..a3ef52b 100644 --- a/org.glite.lb.server/src/stored_master.c +++ b/org.glite.lb.server/src/stored_master.c @@ -121,7 +121,7 @@ int edg_wll_StoreProto(edg_wll_Context ctx) if (sink_mode == GLITE_LB_SINK_PARSE) glite_wll_perftest_consumeEventIlMsg(buf); else #endif - glite_common_log(LOG_CATEGORY_LB_SERVER_REQUEST, LOG_PRIORITY_DEBUG,buf); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_REQUEST, LOG_PRIORITY_DEBUG, buf); handle_il_message(ctx, buf); free(buf); diff --git a/org.glite.lb.server/src/userjobs.c b/org.glite.lb.server/src/userjobs.c index d859a51..f97028f 100644 --- a/org.glite.lb.server/src/userjobs.c +++ b/org.glite.lb.server/src/userjobs.c @@ -58,7 +58,7 @@ int edg_wll_UserJobsServer( free(can_peername); trio_asprintf(&stmt,"select cert_subj from users where userid = '%|Ss'",userid); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); switch (edg_wll_ExecSQL(ctx,stmt,&sth)) { case 0: edg_wll_SetError(ctx,ENOENT,ctx->peerName); @@ -76,7 +76,7 @@ int edg_wll_UserJobsServer( free(res); res = NULL; trio_asprintf(&stmt,"select dg_jobid from jobs where userid = '%|Ss' and grey='0'",userid); - glite_common_log(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); switch (njobs = edg_wll_ExecSQL(ctx,stmt,&sth)) { case 0: edg_wll_SetError(ctx,ENOENT,ctx->peerName); case -1: goto err; diff --git a/org.glite.lbjp-common.db/src/db-mysql.c b/org.glite.lbjp-common.db/src/db-mysql.c index 3b525f6..7b89a40 100644 --- a/org.glite.lbjp-common.db/src/db-mysql.c +++ b/org.glite.lbjp-common.db/src/db-mysql.c @@ -447,7 +447,7 @@ int glite_lbu_QueryIndicesMysql(glite_lbu_DBContext ctx_gen, const char *table, Key_name = Seq_in_index = Column_name = Sub_part = -1; asprintf(&sql, "show index from %s", table); - glite_common_log(ctx_gen->log_category, LOG_PRIORITY_DEBUG, sql); + glite_common_log_msg(ctx_gen->log_category, LOG_PRIORITY_DEBUG, sql); if (glite_lbu_ExecSQLMysql(ctx_gen,sql,&stmt)<0) { free(sql); return STATUS(ctx); @@ -961,7 +961,7 @@ static int transaction_test(glite_lbu_DBContext ctx, int *caps) { glite_lbu_FreeStmtMysql(&stmt); trio_asprintf(&cmd, "SHOW CREATE TABLE %|Ss", table[0]); - glite_common_log(ctx->log_category, LOG_PRIORITY_DEBUG, cmd); + glite_common_log_msg(ctx->log_category, LOG_PRIORITY_DEBUG, cmd); if (glite_lbu_ExecSQLMysql(ctx, cmd, &stmt) <= 0 || (retval = glite_lbu_FetchRowMysql(stmt, 2, NULL, res)) < 0 ) goto quit; if (retval != 2 || strcmp(res[0], table[0])) { ERR(ctx, EIO, "unexpected show create result"); diff --git a/org.glite.lbjp-common.db/src/db-pg.c b/org.glite.lbjp-common.db/src/db-pg.c index c0acfc6..c3d5790 100644 --- a/org.glite.lbjp-common.db/src/db-pg.c +++ b/org.glite.lbjp-common.db/src/db-pg.c @@ -368,7 +368,7 @@ void glite_lbu_FreeStmtPsql(glite_lbu_Statement *stmt_gen) { if (stmt->res) psql_module.PQclear(stmt->res); if (stmt->name) { asprintf(&sql, "DEALLOCATE %s", stmt->name); - glite_common_log(ctx->generic.log_category, LOG_PRIORITY_DEBUG, sql); + glite_common_log_msg(ctx->generic.log_category, LOG_PRIORITY_DEBUG, sql); stmt->res = psql_module.PQexec(ctx->conn, sql); free(sql); psql_module.PQclear(stmt->res); @@ -462,7 +462,7 @@ int glite_lbu_PrepareStmtPsql(glite_lbu_DBContext ctx_gen, const char *sql, glit asprintf(&stmt->name, "%s%d", prepared_names[i], ++ctx->prepared_counts[i]); asprintf(&sqlPrep, "PREPARE %s AS %s", stmt->name, stmt->sql); - glite_common_log(ctx_gen->log_category, LOG_PRIORITY_DEBUG, sqlPrep); + glite_common_log_msg(ctx_gen->log_category, LOG_PRIORITY_DEBUG, sqlPrep); res = psql_module.PQexec(ctx->conn, sqlPrep); if (psql_module.PQresultStatus(res) != PGRES_COMMAND_OK) { asprintf(&s, "error preparing command: %s", psql_module.PQerrorMessage(ctx->conn)); @@ -592,7 +592,7 @@ int glite_lbu_ExecPreparedStmtPsql_v(glite_lbu_Statement stmt_gen, int n, va_lis } if (n) strcat(sql, ")"); - glite_common_log(ctx->generic.log_category, LOG_PRIORITY_DEBUG, sql); + glite_common_log_msg(ctx->generic.log_category, LOG_PRIORITY_DEBUG, sql); stmt->res = psql_module.PQexec(ctx->conn, sql); status = psql_module.PQresultStatus(stmt->res); if (status != PGRES_COMMAND_OK && status != PGRES_TUPLES_OK) { diff --git a/org.glite.lbjp-common.db/src/db.c b/org.glite.lbjp-common.db/src/db.c index 095a28b..d4a1760 100644 --- a/org.glite.lbjp-common.db/src/db.c +++ b/org.glite.lbjp-common.db/src/db.c @@ -396,7 +396,7 @@ static int flush_bufferd_insert(glite_lbu_bufInsert bi) trio_asprintf(&stmt, "insert into %|Ss(%|Ss) values %s;", bi->table_name, bi->columns, vals); - glite_common_log(bi->ctx->log_category, LOG_PRIORITY_DEBUG, stmt); + glite_common_log_msg(bi->ctx->log_category, LOG_PRIORITY_DEBUG, stmt); if (glite_lbu_ExecSQL(bi->ctx,stmt,NULL) < 0) { if (STATUS(bi->ctx) == EEXIST) diff --git a/org.glite.lbjp-common.log/src/log.c b/org.glite.lbjp-common.log/src/log.c index 485d7db..0dad938 100644 --- a/org.glite.lbjp-common.log/src/log.c +++ b/org.glite.lbjp-common.log/src/log.c @@ -59,7 +59,7 @@ void glite_common_log_msg(char *catName,int a_priority, char *msg) { const log4c_category_t* a_category = log4c_category_get(catName); if (log4c_category_is_priority_enabled(a_category, a_priority)) { - log4c_category_log(log4c_category_get(catName), a_priority, msg); + log4c_category_log(log4c_category_get(catName), a_priority, "%s", msg); } #else printf(msg); diff --git a/org.glite.lbjp-common.log/src/log.h b/org.glite.lbjp-common.log/src/log.h index bfbdc14..25ab863 100644 --- a/org.glite.lbjp-common.log/src/log.h +++ b/org.glite.lbjp-common.log/src/log.h @@ -83,7 +83,7 @@ extern void glite_common_log_msg(char *catName,int a_priority, char *msg); * @param a_format Format specifier for the string to write in the log file. * @param ... The arguments for a_format **/ -extern void glite_common_log(char *catName,int a_priority, const char* a_format,...); +extern void glite_common_log(char *catName,int a_priority, const char* a_format,...) __attribute__((format(printf, 3, 4))); /** * Returns priority as a string diff --git a/org.glite.lbjp-common.server-bones/src/srvbones.c b/org.glite.lbjp-common.server-bones/src/srvbones.c index dd257cd..20cb3eb 100644 --- a/org.glite.lbjp-common.server-bones/src/srvbones.c +++ b/org.glite.lbjp-common.server-bones/src/srvbones.c @@ -313,7 +313,7 @@ int glite_srvbones_daemonize(const char *servername, const char *custom_pidfile, } fclose(fpid); } else if (errno != ENOENT) { - glite_common_log(LOG_CATEGORY_CONTROL, LOG_PRIORITY_FATAL, pidfile); + glite_common_log_msg(LOG_CATEGORY_CONTROL, LOG_PRIORITY_FATAL, pidfile); free(pidfile); return 0; } @@ -321,7 +321,7 @@ int glite_srvbones_daemonize(const char *servername, const char *custom_pidfile, if (((fpid = fopen(pidfile, "w")) == NULL) || (fprintf(fpid, "%d", getpid()) <= 0) || (fclose(fpid) != 0)) { - glite_common_log(LOG_CATEGORY_CONTROL, LOG_PRIORITY_FATAL, pidfile); + glite_common_log_msg(LOG_CATEGORY_CONTROL, LOG_PRIORITY_FATAL, pidfile); free(pidfile); return 0; } -- 1.8.2.3