From 0faa1ac9b136eb4ccefa38e8f78d8f4f0946e625 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Daniel=20Kou=C5=99il?= Date: Mon, 6 Aug 2007 14:57:19 +0000 Subject: [PATCH] Second round of removal of globus dependencies - removed globus headers - removed initialization of globus modules - added some missing headers - s/gss_release_cred/edg_wll_gss_release_cred - gssapi structs and consts renamed to equivalents from glite_gss.h - edg_wll_gss_get_client_conn() used instead of gss_inquire_context() to get information about the client --- org.glite.lb.client/examples/log_usertag_proxy.c | 7 --- org.glite.lb.client/examples/query_seq_code.c | 7 --- org.glite.lb.client/examples/user_jobs_threaded.c | 6 --- org.glite.lb.client/src/connection.c | 10 ++-- org.glite.lb.client/src/logevent.c.T | 5 +- org.glite.lb.client/src/notification.c | 4 +- org.glite.lb.client/src/prod_proto.c | 9 ++-- org.glite.lb.client/src/producer.c | 14 +++--- org.glite.lb.common/interface/connpool.h | 2 +- org.glite.lb.common/src/connpool.c | 4 +- org.glite.lb.common/src/context.c | 5 +- org.glite.lb.common/src/log_msg.c | 1 + org.glite.lb.common/src/mini_http.c | 4 +- org.glite.lb.common/src/xml_parse.c.T | 1 + org.glite.lb.logger/src/event_store.c | 1 + org.glite.lb.logger/src/il_error.c | 3 -- org.glite.lb.logger/src/interlogd.c | 4 +- org.glite.lb.logger/src/interlogd.h | 2 +- org.glite.lb.logger/src/logd.c | 58 ++++++++--------------- org.glite.lb.logger/src/logd_proto.c | 3 ++ org.glite.lb.logger/src/recover.c | 7 ++- org.glite.lb.logger/src/send_event.c | 10 ++-- 22 files changed, 64 insertions(+), 103 deletions(-) diff --git a/org.glite.lb.client/examples/log_usertag_proxy.c b/org.glite.lb.client/examples/log_usertag_proxy.c index 26a4bf8..0bafaa0 100644 --- a/org.glite.lb.client/examples/log_usertag_proxy.c +++ b/org.glite.lb.client/examples/log_usertag_proxy.c @@ -5,8 +5,6 @@ #include #include -#include - #include "glite/wmsutils/jobid/cjobid.h" #include "glite/lb/notifid.h" #include "glite/lb/events.h" @@ -65,11 +63,6 @@ int main(int argc, char *argv[]) if ( (errno = edg_wlc_JobIdParse(jobid_s, &jobid)) ) { perror(jobid_s); return 1; } - if (globus_module_activate(GLOBUS_COMMON_MODULE) != GLOBUS_SUCCESS) { - fprintf(stderr, "Cannot initialize Globus common module\n"); - exit(1); - } - edg_wll_InitContext(&ctx); if ( !user ) { diff --git a/org.glite.lb.client/examples/query_seq_code.c b/org.glite.lb.client/examples/query_seq_code.c index 7fd325b..97f0d7c 100644 --- a/org.glite.lb.client/examples/query_seq_code.c +++ b/org.glite.lb.client/examples/query_seq_code.c @@ -5,8 +5,6 @@ #include #include -#include - #include "glite/wmsutils/jobid/cjobid.h" #include "consumer.h" @@ -49,11 +47,6 @@ int main(int argc, char *argv[]) if ( (errno = edg_wlc_JobIdParse(jobid_s, &jobid)) ) { perror(jobid_s); return 1; } - if (globus_module_activate(GLOBUS_COMMON_MODULE) != GLOBUS_SUCCESS) { - fprintf(stderr, "Cannot initialize Globus common module\n"); - exit(1); - } - edg_wll_InitContext(&ctx); edg_wll_SetParam(ctx, EDG_WLL_PARAM_SOURCE, EDG_WLL_SOURCE_USER_INTERFACE); diff --git a/org.glite.lb.client/examples/user_jobs_threaded.c b/org.glite.lb.client/examples/user_jobs_threaded.c index 33c2b77..b6c9a59 100644 --- a/org.glite.lb.client/examples/user_jobs_threaded.c +++ b/org.glite.lb.client/examples/user_jobs_threaded.c @@ -9,7 +9,6 @@ #include #include -#include #include "glite/lb/context.h" #include "glite/lb/xml_conversions.h" @@ -183,11 +182,6 @@ int main(int argc,char **argv) pthread_t threads[thr_num]; pthread_attr_t attr; - if (globus_module_activate(GLOBUS_COMMON_MODULE) != GLOBUS_SUCCESS) { - fputs("globus_module_activate()\n",stderr); - return 1; - } - pthread_attr_init(&attr); pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); diff --git a/org.glite.lb.client/src/connection.c b/org.glite.lb.client/src/connection.c index 47d396e..0178abe 100644 --- a/org.glite.lb.client/src/connection.c +++ b/org.glite.lb.client/src/connection.c @@ -1,5 +1,6 @@ #ident "$Header$" +#include #include #include #include @@ -25,7 +26,6 @@ int CloseConnection(edg_wll_Context ctx, int* conn_index) // XXX: should change the parameter conn_index to int (parameter is IN only) { /* close connection and free its structures */ - OM_uint32 min_stat; int cIndex,ret = 0; cIndex = *conn_index; @@ -34,8 +34,8 @@ int CloseConnection(edg_wll_Context ctx, int* conn_index) if (ctx->connections->connPool[cIndex].gss.sock) ret = edg_wll_gss_close(&ctx->connections->connPool[cIndex].gss, &ctx->p_tmp_timeout); - if (ctx->connections->connPool[cIndex].gsiCred != GSS_C_NO_CREDENTIAL) - gss_release_cred(&min_stat, &ctx->connections->connPool[cIndex].gsiCred); + if (ctx->connections->connPool[cIndex].gsiCred != NULL) + edg_wll_gss_release_cred(&ctx->connections->connPool[cIndex].gsiCred, NULL); free(ctx->connections->connPool[cIndex].peerName); free(ctx->connections->connPool[cIndex].buf); @@ -104,7 +104,7 @@ int AddConnection(edg_wll_Context ctx, char *name, int port) free(ctx->connections->connPool[index].peerName); // should be empty; just to be sure ctx->connections->connPool[index].peerName = strdup(name); ctx->connections->connPool[index].peerPort = port; - ctx->connections->connPool[index].gsiCred = GSS_C_NO_CREDENTIAL; // initial value + ctx->connections->connPool[index].gsiCred = NULL; // initial value ctx->connections->connOpened++; return index; @@ -221,7 +221,7 @@ int edg_wll_open(edg_wll_Context ctx, int* connToUse) goto err; } - if (ctx->connections->connPool[index].gss.context == GSS_C_NO_CONTEXT) { + if (ctx->connections->connPool[index].gss.context == NULL) { switch (edg_wll_gss_connect(ctx->connections->connPool[index].gsiCred, ctx->connections->connPool[index].peerName, ctx->connections->connPool[index].peerPort, &ctx->p_tmp_timeout,&ctx->connections->connPool[index].gss, diff --git a/org.glite.lb.client/src/logevent.c.T b/org.glite.lb.client/src/logevent.c.T index 80588a4..87162c4 100644 --- a/org.glite.lb.client/src/logevent.c.T +++ b/org.glite.lb.client/src/logevent.c.T @@ -163,12 +163,11 @@ int main(int argc, char *argv[]) if ( use_lbproxy ) { if ( !lbproxy_user ) { - gss_cred_id_t gss_cred = GSS_C_NO_CREDENTIAL; + edg_wll_GssCred gss_cred = NULL; edg_wll_GssStatus gss_stat; - OM_uint32 min_stat; if ( edg_wll_gss_acquire_cred_gsi(NULL, NULL, &gss_cred, &lbproxy_user, &gss_stat) ) lbproxy_user = "anonymous"; - if ( gss_cred != GSS_C_NO_CREDENTIAL ) gss_release_cred(&min_stat, &gss_cred); + if ( gss_cred != NULL ) edg_wll_gss_release_cred(&gss_cred, NULL); } if ( lbproxy_store_sock ) edg_wll_SetParam(ctx, EDG_WLL_PARAM_LBPROXY_STORE_SOCK, lbproxy_store_sock); diff --git a/org.glite.lb.client/src/notification.c b/org.glite.lb.client/src/notification.c index 8542f77..0b7bc1a 100644 --- a/org.glite.lb.client/src/notification.c +++ b/org.glite.lb.client/src/notification.c @@ -748,7 +748,7 @@ select: /* notif_send() & notif_receive() should then migrate to */ /* client/connection.c and use connPool management f-cions */ - if (ctx->connPoolNotif[0].gss.context == GSS_C_NO_CONTEXT) + if (ctx->connPoolNotif[0].gss.context == NULL) { int ret; switch(poll(pollfds, 1, tv.tv_sec*1000+tv.tv_usec/1000)) { @@ -903,7 +903,7 @@ int edg_wll_NotifCloseFd( int err; if (ctx->notifSock >= 0) { - if (ctx->connPoolNotif[0].gss.context != GSS_C_NO_CONTEXT) { + if (ctx->connPoolNotif[0].gss.context != NULL) { edg_wll_gss_close(&ctx->connPoolNotif[0].gss, NULL); } err = close(ctx->notifSock); diff --git a/org.glite.lb.client/src/prod_proto.c b/org.glite.lb.client/src/prod_proto.c index 38a5643..84882a4 100644 --- a/org.glite.lb.client/src/prod_proto.c +++ b/org.glite.lb.client/src/prod_proto.c @@ -259,7 +259,7 @@ int edg_wll_log_connect(edg_wll_Context ctx, int *conn) ctx->connections->connPool[index].peerPort); #endif /* gss_connect */ - if (ctx->connections->connPool[index].gss.context == GSS_C_NO_CONTEXT) { + if (ctx->connections->connPool[index].gss.context == NULL) { /* acquire gss credentials */ ret = edg_wll_gss_acquire_cred_gsi( @@ -636,8 +636,7 @@ int edg_wll_log_direct_connect(edg_wll_Context ctx, edg_wll_GssConnection *conn) int ret,answer; char *my_subject_name = NULL; edg_wll_GssStatus gss_stat; - gss_cred_id_t cred = GSS_C_NO_CREDENTIAL; - OM_uint32 min_stat; + edg_wll_GssCred cred = NULL; char *host; int port; @@ -683,8 +682,8 @@ edg_wll_log_direct_connect_end: fprintf(stderr,"edg_wll_log_direct_connect: done (remaining timeout %d.%06d sec)\n", (int) ctx->p_tmp_timeout.tv_sec, (int) ctx->p_tmp_timeout.tv_usec); #endif - if (cred != GSS_C_NO_CREDENTIAL) - gss_release_cred(&min_stat, &cred); + if (cred != NULL) + edg_wll_gss_release_cred(&cred, NULL); if (my_subject_name) free(my_subject_name); if (host) free(host); diff --git a/org.glite.lb.client/src/producer.c b/org.glite.lb.client/src/producer.c index 3d40357..a402719 100644 --- a/org.glite.lb.client/src/producer.c +++ b/org.glite.lb.client/src/producer.c @@ -634,8 +634,7 @@ int edg_wll_SetLoggingJob( { char *my_subject_name = NULL; edg_wll_GssStatus gss_stat; - gss_cred_id_t cred = GSS_C_NO_CREDENTIAL; - OM_uint32 min_stat; + edg_wll_GssCred cred = NULL; /* acquire gss credentials */ err = edg_wll_gss_acquire_cred_gsi( @@ -649,8 +648,8 @@ int edg_wll_SetLoggingJob( } else { edg_wll_SetParamString(ctx, EDG_WLL_PARAM_LBPROXY_USER, my_subject_name); } - if (cred != GSS_C_NO_CREDENTIAL) - gss_release_cred(&min_stat, &cred); + if (cred != NULL) + edg_wll_gss_release_cred(&cred, NULL); if (my_subject_name) free(my_subject_name); } @@ -689,8 +688,7 @@ int edg_wll_SetLoggingJobProxy( } else { char *my_subject_name = NULL; edg_wll_GssStatus gss_stat; - gss_cred_id_t cred = GSS_C_NO_CREDENTIAL; - OM_uint32 min_stat; + edg_wll_GssCred cred = NULL; /* acquire gss credentials */ err = edg_wll_gss_acquire_cred_gsi( @@ -705,8 +703,8 @@ int edg_wll_SetLoggingJobProxy( edg_wll_SetParamString(ctx, EDG_WLL_PARAM_LBPROXY_USER, my_subject_name); } - if (cred != GSS_C_NO_CREDENTIAL) - gss_release_cred(&min_stat, &cred); + if (cred != NULL) + edg_wll_gss_release_cred(&cred, NULL); if (my_subject_name) free(my_subject_name); } diff --git a/org.glite.lb.common/interface/connpool.h b/org.glite.lb.common/interface/connpool.h index e29f185..5c67284 100644 --- a/org.glite.lb.common/interface/connpool.h +++ b/org.glite.lb.common/interface/connpool.h @@ -25,7 +25,7 @@ typedef struct _edg_wll_ConnPool { unsigned int peerPort; /* http(s) stream */ - gss_cred_id_t gsiCred; + edg_wll_GssCred gsiCred; edg_wll_GssConnection gss; char *buf; int bufUse,bufSize; diff --git a/org.glite.lb.common/src/connpool.c b/org.glite.lb.common/src/connpool.c index 729fb5b..2834f9c 100644 --- a/org.glite.lb.common/src/connpool.c +++ b/org.glite.lb.common/src/connpool.c @@ -201,8 +201,6 @@ int RetVal; void edg_wll_poolFree() { int i; struct timeval close_timeout = {0, 50000}; /* Declarations taken over from edg_wll_FreeContext() */ - OM_uint32 min_stat; /* Does not seem to have any use whatsoever - neither - here nor in edg_wll_FreeContext() */ #ifdef EDG_WLL_CONNPOOL_DEBUG #ifdef GLITE_LB_THREADED @@ -216,7 +214,7 @@ void edg_wll_poolFree() { if (connectionsHandle.connPool[i].peerName) free(connectionsHandle.connPool[i].peerName); edg_wll_gss_close(&connectionsHandle.connPool[i].gss,&close_timeout); if (connectionsHandle.connPool[i].gsiCred) - gss_release_cred(&min_stat, &connectionsHandle.connPool[i].gsiCred); + edg_wll_gss_release_cred(&connectionsHandle.connPool[i].gsiCred, NULL); if (connectionsHandle.connPool[i].buf) free(connectionsHandle.connPool[i].buf); } diff --git a/org.glite.lb.common/src/context.c b/org.glite.lb.common/src/context.c index 8874152..ecda2a1 100644 --- a/org.glite.lb.common/src/context.c +++ b/org.glite.lb.common/src/context.c @@ -61,7 +61,6 @@ int edg_wll_InitContext(edg_wll_Context *ctx) void edg_wll_FreeContext(edg_wll_Context ctx) { struct timeval close_timeout = {0, 50000}; - OM_uint32 min_stat; if (!ctx) return; #ifdef CTXTRACE @@ -108,7 +107,7 @@ void edg_wll_FreeContext(edg_wll_Context ctx) if (ctx->connections->connPool[i].peerName) free(ctx->connections->connPool[i].peerName); edg_wll_gss_close(&ctx->connections->connPool[i].gss,&close_timeout); if (ctx->connections->connPool[i].gsiCred) - gss_release_cred(&min_stat, &ctx->connections->connPool[i].gsiCred); + edg_wll_gss_release_cred(&ctx->connections->connPool[i].gsiCred, NULL); if (ctx->connections->connPool[i].buf) free(ctx->connections->connPool[i].buf); } free(ctx->connections->connPool);*/ @@ -117,7 +116,7 @@ void edg_wll_FreeContext(edg_wll_Context ctx) if (ctx->connPoolNotif[0].peerName) free(ctx->connPoolNotif[0].peerName); edg_wll_gss_close(&ctx->connPoolNotif[0].gss,&close_timeout); if (ctx->connPoolNotif[0].gsiCred) - gss_release_cred(&min_stat, &ctx->connPoolNotif[0].gsiCred); + edg_wll_gss_release_cred(&ctx->connPoolNotif[0].gsiCred, NULL); if (ctx->connPoolNotif[0].buf) free(ctx->connPoolNotif[0].buf); free(ctx->connPoolNotif); } diff --git a/org.glite.lb.common/src/log_msg.c b/org.glite.lb.common/src/log_msg.c index 16af14b..fe58f1c 100644 --- a/org.glite.lb.common/src/log_msg.c +++ b/org.glite.lb.common/src/log_msg.c @@ -8,6 +8,7 @@ #include #include #include +#include #include "glite/lb/context-int.h" diff --git a/org.glite.lb.common/src/mini_http.c b/org.glite.lb.common/src/mini_http.c index d591ea0..6e803cf 100644 --- a/org.glite.lb.common/src/mini_http.c +++ b/org.glite.lb.common/src/mini_http.c @@ -33,7 +33,7 @@ edg_wll_ErrorCode edg_wll_http_recv(edg_wll_Context ctx,char **firstOut,char *** } edg_wll_ResetError(ctx); - if (connPTR->gss.context != GSS_C_NO_CONTEXT) + if (connPTR->gss.context != NULL) sock = connPTR->gss.sock; else { edg_wll_SetError(ctx,ENOTCONN,NULL); @@ -302,7 +302,7 @@ edg_wll_ErrorCode edg_wll_http_send(edg_wll_Context ctx,const char *first,const edg_wll_ResetError(ctx); - if (connPTR->gss.context == GSS_C_NO_CONTEXT) + if (connPTR->gss.context == NULL) return edg_wll_SetError(ctx,ENOTCONN,NULL); if (real_write(ctx,&connPTR->gss,first,strlen(first)) < 0 || diff --git a/org.glite.lb.common/src/xml_parse.c.T b/org.glite.lb.common/src/xml_parse.c.T index 0b7615c..59db54e 100644 --- a/org.glite.lb.common/src/xml_parse.c.T +++ b/org.glite.lb.common/src/xml_parse.c.T @@ -4,6 +4,7 @@ #include #include #include +#include #include // Expat header file diff --git a/org.glite.lb.logger/src/event_store.c b/org.glite.lb.logger/src/event_store.c index 915c949..53d416f 100644 --- a/org.glite.lb.logger/src/event_store.c +++ b/org.glite.lb.logger/src/event_store.c @@ -12,6 +12,7 @@ #include #endif #include +#include #include "glite/lb/events_parse.h" diff --git a/org.glite.lb.logger/src/il_error.c b/org.glite.lb.logger/src/il_error.c index 1fe9bb9..4229984 100644 --- a/org.glite.lb.logger/src/il_error.c +++ b/org.glite.lb.logger/src/il_error.c @@ -13,9 +13,6 @@ extern void _start (void), etext (void); #endif -/* XXX DK: */ -#include // SSL header file - #include "glite/security/glite_gss.h" #include "il_error.h" diff --git a/org.glite.lb.logger/src/interlogd.c b/org.glite.lb.logger/src/interlogd.c index bcb8b85..a7f1601 100644 --- a/org.glite.lb.logger/src/interlogd.c +++ b/org.glite.lb.logger/src/interlogd.c @@ -4,10 +4,12 @@ interlogger - collect events from local-logger and send them to logging and bookkeeping servers */ +#include #include #include #include #include +#include #include "interlogd.h" #include "glite/lb/log_proto.h" @@ -32,7 +34,7 @@ int killflg = 0; int TIMEOUT = DEFAULT_TIMEOUT; -gss_cred_id_t cred_handle = GSS_C_NO_CREDENTIAL; +edg_wll_GssCred cred_handle = NULL; pthread_mutex_t cred_handle_lock = PTHREAD_MUTEX_INITIALIZER; time_t key_mtime = 0, cert_mtime = 0; diff --git a/org.glite.lb.logger/src/interlogd.h b/org.glite.lb.logger/src/interlogd.h index 810314e..0af27ff 100644 --- a/org.glite.lb.logger/src/interlogd.h +++ b/org.glite.lb.logger/src/interlogd.h @@ -63,7 +63,7 @@ extern int TIMEOUT; #define INPUT_TIMEOUT (60) -extern gss_cred_id_t cred_handle; +extern edg_wll_GssCred cred_handle; extern pthread_mutex_t cred_handle_lock; extern char *cert_file; extern char *key_file; diff --git a/org.glite.lb.logger/src/logd.c b/org.glite.lb.logger/src/logd.c index 219cefd..1a7986b 100644 --- a/org.glite.lb.logger/src/logd.c +++ b/org.glite.lb.logger/src/logd.c @@ -1,5 +1,6 @@ #ident "$Header$" +#include #include #include #include @@ -11,6 +12,7 @@ #include #include #include +#include #include "glite/lb/context-int.h" #include "glite/lb/timeouts.h" @@ -144,17 +146,14 @@ void handle_signal(int num) { *---------------------------------------------------------------------- */ static int -doit(int socket, gss_cred_id_t cred_handle, char *file_name_prefix, int noipc, int noparse) +doit(int socket, edg_wll_GssCred cred_handle, char *file_name_prefix, int noipc, int noparse) { char *subject; int ret,fd,count; struct timeval timeout; edg_wll_GssConnection con; edg_wll_GssStatus gss_stat; - gss_buffer_desc gss_token = GSS_C_EMPTY_BUFFER; - gss_name_t client_name = GSS_C_NO_NAME; - OM_uint32 min_stat; - gss_OID name_type = GSS_C_NO_OID; + edg_wll_GssPrincipal client = NULL; fd_set fdset; struct sockaddr_in peer; socklen_t alen = sizeof peer; @@ -177,34 +176,24 @@ doit(int socket, gss_cred_id_t cred_handle, char *file_name_prefix, int noipc, i /* authenticate */ edg_wll_ll_log(LOG_INFO,"Processing authentication:\n"); - gss_stat.major_status = gss_inquire_context(&gss_stat.minor_status, con.context, - &client_name, NULL, NULL, NULL, NULL, - NULL, NULL); - if (GSS_ERROR(gss_stat.major_status)) { - char *gss_err; - edg_wll_gss_get_error(&gss_stat, "Cannot read client identification", &gss_err); - edg_wll_ll_log(LOG_WARNING, "%s: %s\n", inet_ntoa(peer.sin_addr),gss_err); - free(gss_err); - } else { - gss_stat.major_status = gss_display_name(&gss_stat.minor_status, client_name, - &gss_token, &name_type); - if (GSS_ERROR(gss_stat.major_status)) { - char *gss_err; - edg_wll_gss_get_error(&gss_stat, "Cannot process client identification", &gss_err); - edg_wll_ll_log(LOG_WARNING, "%s: %s\n",inet_ntoa(peer.sin_addr),gss_err); - free(gss_err); - } + ret = edg_wll_gss_get_client_conn(&con, &client, &gss_stat); + if (ret) { + char *gss_err; + edg_wll_gss_get_error(&gss_stat, "Cannot read client identification", &gss_err); + edg_wll_ll_log(LOG_WARNING, "%s: %s\n", inet_ntoa(peer.sin_addr),gss_err); + free(gss_err); } - if (GSS_ERROR(gss_stat.major_status) || edg_wll_gss_oid_equal(name_type, GSS_C_NT_ANONYMOUS)) { + if (ret || client->flags | EDG_WLL_GSS_FLAG_ANON) { edg_wll_ll_log(LOG_INFO," User not authenticated, setting as \"%s\". \n",EDG_WLL_LOG_USER_DEFAULT); subject=strdup(EDG_WLL_LOG_USER_DEFAULT); } else { edg_wll_ll_log(LOG_INFO," User successfully authenticated as:\n"); - edg_wll_ll_log(LOG_INFO, " %s\n", (char *)gss_token.value); - subject=gss_token.value; - memset(&gss_token.value, 0, sizeof(gss_token.value)); + edg_wll_ll_log(LOG_INFO, " %s\n", client->name); + subject=client->name; } + if (client) + edg_wll_gss_free_princ(client); /* get and process the data */ timeout.tv_sec = CONNECTION_TIMEOUT; @@ -264,10 +253,6 @@ doit_end: if (con.sock == -1) edg_wll_ll_log(LOG_DEBUG, "o.k.\n"); if (subject) free(subject); - if (gss_token.length) - gss_release_buffer(&min_stat, &gss_token); - if (client_name != GSS_C_NO_NAME) - gss_release_name(&min_stat, &client_name); return ret; } @@ -292,9 +277,8 @@ int main(int argc, char *argv[]) char *my_subject_name = NULL; time_t cert_mtime = 0, key_mtime = 0; - OM_uint32 min_stat; edg_wll_GssStatus gss_stat; - gss_cred_id_t cred = GSS_C_NO_CREDENTIAL; + edg_wll_GssCred cred = NULL; setlinebuf(stdout); @@ -413,7 +397,7 @@ This is LocalLogger, part of Workload Management System in EU DataGrid & EGEE.\n listener_fd = do_listen(port); if (listener_fd == -1) { edg_wll_ll_log(LOG_CRIT,"Failed to listen on port %d\n",port); - gss_release_cred(&min_stat, &cred); + edg_wll_gss_release_cred(&cred, NULL); exit(-1); } else { edg_wll_ll_log(LOG_DEBUG,"Listener's socket descriptor is '%d'\n",listener_fd); @@ -445,14 +429,14 @@ This is LocalLogger, part of Workload Management System in EU DataGrid & EGEE.\n close(listener_fd); edg_wll_ll_log(LOG_CRIT,"Failed to accept incomming connections\n"); SYSTEM_ERROR("accept"); - gss_release_cred(&min_stat, &cred); + edg_wll_gss_release_cred(&cred, NULL); exit(-1); } else { edg_wll_ll_log(LOG_DEBUG,"Incomming connection on socket '%d'\n",client_fd); } switch (edg_wll_gss_watch_creds(cert_file,&cert_mtime)) { - gss_cred_id_t newcred; + edg_wll_GssCred newcred; case 0: break; case 1: ret = edg_wll_gss_acquire_cred_gsi(cert_file,key_file,&newcred,NULL,&gss_stat); @@ -460,7 +444,7 @@ This is LocalLogger, part of Workload Management System in EU DataGrid & EGEE.\n edg_wll_ll_log(LOG_WARNING,"Reloading credentials failed, continue with older\n"); } else { edg_wll_ll_log(LOG_INFO,"Reloading credentials\n"); - gss_release_cred(&min_stat, &cred); + edg_wll_gss_release_cred(&cred, NULL); cred = newcred; } break; @@ -495,6 +479,6 @@ This is LocalLogger, part of Workload Management System in EU DataGrid & EGEE.\n end: if (listener_fd) close(listener_fd); - gss_release_cred(&min_stat, &cred); + edg_wll_gss_release_cred(&cred, NULL); exit(ret); } diff --git a/org.glite.lb.logger/src/logd_proto.c b/org.glite.lb.logger/src/logd_proto.c index 6bbc328..bca275c 100644 --- a/org.glite.lb.logger/src/logd_proto.c +++ b/org.glite.lb.logger/src/logd_proto.c @@ -1,5 +1,6 @@ #ident "$Header$" +#include #include #include #include @@ -9,6 +10,8 @@ #include #include #include +#include +#include #include "glite/lb/context-int.h" #include "glite/lb/escape.h" diff --git a/org.glite.lb.logger/src/recover.c b/org.glite.lb.logger/src/recover.c index ed31186..0c532a9 100644 --- a/org.glite.lb.logger/src/recover.c +++ b/org.glite.lb.logger/src/recover.c @@ -36,14 +36,13 @@ recover_thread(void *q) if(pthread_mutex_lock(&cred_handle_lock) < 0) abort(); if (edg_wll_gss_watch_creds(cert_file, &cert_mtime) > 0) { - gss_cred_id_t new_cred_handle = GSS_C_NO_CREDENTIAL; - OM_uint32 min_stat; + edg_wll_GssCred new_cred_handle = NULL; int ret; ret = edg_wll_gss_acquire_cred_gsi(cert_file,key_file, &new_cred_handle, NULL, NULL); - if (new_cred_handle != GSS_C_NO_CREDENTIAL) { - gss_release_cred(&min_stat, &cred_handle); + if (new_cred_handle != NULL) { + edg_wll_gss_release_cred(&cred_handle, NULL); cred_handle = new_cred_handle; il_log(LOG_INFO, "New certificate found and deployed.\n"); } diff --git a/org.glite.lb.logger/src/send_event.c b/org.glite.lb.logger/src/send_event.c index 6a98039..c9833a4 100644 --- a/org.glite.lb.logger/src/send_event.c +++ b/org.glite.lb.logger/src/send_event.c @@ -172,7 +172,7 @@ event_queue_connect(struct event_queue *eq) if(!nosend) { #endif - if(eq->gss.context == GSS_C_NO_CONTEXT) { + if(eq->gss.context == NULL) { tv.tv_sec = TIMEOUT; tv.tv_usec = 0; @@ -190,7 +190,7 @@ event_queue_connect(struct event_queue *eq) set_error(IL_DGGSS, ret, (ret == EDG_WLL_GSS_ERROR_GSS) ? gss_err : "event_queue_connect: edg_wll_gss_connect"); if (gss_err) free(gss_err); - eq->gss.context = GSS_C_NO_CONTEXT; + eq->gss.context = NULL; eq->timeout = TIMEOUT; return(0); } @@ -213,9 +213,9 @@ event_queue_close(struct event_queue *eq) if(!nosend) { #endif - if(eq->gss.context != GSS_C_NO_CONTEXT) { + if(eq->gss.context != NULL) { edg_wll_gss_close(&eq->gss, NULL); - eq->gss.context = GSS_C_NO_CONTEXT; + eq->gss.context = NULL; } #ifdef LB_PERF } @@ -237,7 +237,7 @@ event_queue_send(struct event_queue *eq) #ifdef LB_PERF if(!nosend) { #endif - if(eq->gss.context == GSS_C_NO_CONTEXT) + if(eq->gss.context == NULL) return(0); #ifdef LB_PERF } -- 1.8.2.3