Second round of removal of globus dependencies
authorDaniel Kouřil <kouril@ics.muni.cz>
Mon, 6 Aug 2007 14:57:19 +0000 (14:57 +0000)
committerDaniel Kouřil <kouril@ics.muni.cz>
Mon, 6 Aug 2007 14:57:19 +0000 (14:57 +0000)
- 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

22 files changed:
org.glite.lb.client/examples/log_usertag_proxy.c
org.glite.lb.client/examples/query_seq_code.c
org.glite.lb.client/examples/user_jobs_threaded.c
org.glite.lb.client/src/connection.c
org.glite.lb.client/src/logevent.c.T
org.glite.lb.client/src/notification.c
org.glite.lb.client/src/prod_proto.c
org.glite.lb.client/src/producer.c
org.glite.lb.common/interface/connpool.h
org.glite.lb.common/src/connpool.c
org.glite.lb.common/src/context.c
org.glite.lb.common/src/log_msg.c
org.glite.lb.common/src/mini_http.c
org.glite.lb.common/src/xml_parse.c.T
org.glite.lb.logger/src/event_store.c
org.glite.lb.logger/src/il_error.c
org.glite.lb.logger/src/interlogd.c
org.glite.lb.logger/src/interlogd.h
org.glite.lb.logger/src/logd.c
org.glite.lb.logger/src/logd_proto.c
org.glite.lb.logger/src/recover.c
org.glite.lb.logger/src/send_event.c

index 26a4bf8..0bafaa0 100644 (file)
@@ -5,8 +5,6 @@
 #include <string.h>
 #include <errno.h>
 
-#include <globus_common.h>
-
 #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 ) {
index 7fd325b..97f0d7c 100644 (file)
@@ -5,8 +5,6 @@
 #include <string.h>
 #include <errno.h>
 
-#include <globus_common.h>
-
 #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);
index 33c2b77..b6c9a59 100644 (file)
@@ -9,7 +9,6 @@
 #include <expat.h>
 
 #include <pthread.h>
-#include <globus_common.h>
 
 #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);
        
index 47d396e..0178abe 100644 (file)
@@ -1,5 +1,6 @@
 #ident "$Header$"
 
+#include <stdio.h>
 #include <errno.h>
 #include <string.h>
 #include <stdlib.h>
@@ -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,
index 80588a4..87162c4 100644 (file)
@@ -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);
index 8542f77..0b7bc1a 100644 (file)
@@ -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);
index 38a5643..84882a4 100644 (file)
@@ -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);
 
index 3d40357..a402719 100644 (file)
@@ -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);
        }
 
index e29f185..5c67284 100644 (file)
@@ -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;
index 729fb5b..2834f9c 100644 (file)
@@ -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);
         }
 
index 8874152..ecda2a1 100644 (file)
@@ -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);
        }
index 16af14b..fe58f1c 100644 (file)
@@ -8,6 +8,7 @@
 #include <math.h>
 #include <sys/stat.h>
 #include <unistd.h>
+#include <errno.h>
 
 #include "glite/lb/context-int.h"
 
index d591ea0..6e803cf 100644 (file)
@@ -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 ||
index 0b7615c..59db54e 100644 (file)
@@ -4,6 +4,7 @@
 #include <ctype.h>
 #include <string.h>
 #include <assert.h>
+#include <errno.h>
 
 #include <expat.h>     // Expat header file
 
index 915c949..53d416f 100644 (file)
@@ -12,6 +12,7 @@
 #include <unistd.h>
 #endif
 #include <fcntl.h>
+#include <sys/param.h>
 
 #include "glite/lb/events_parse.h"
 
index 1fe9bb9..4229984 100644 (file)
@@ -13,9 +13,6 @@
 extern void _start (void), etext (void);
 #endif
 
-/* XXX DK: */
-#include <err.h> // SSL header file 
-
 #include "glite/security/glite_gss.h"
 
 #include "il_error.h"
index bcb8b85..a7f1601 100644 (file)
@@ -4,10 +4,12 @@
    interlogger - collect events from local-logger and send them to logging and bookkeeping servers
 
 */
+#include <stdio.h>
 #include <getopt.h>
 #include <string.h>
 #include <signal.h>
 #include <pthread.h>
+#include <errno.h>
 
 #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;
index 810314e..0af27ff 100644 (file)
@@ -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;
index 219cefd..1a7986b 100644 (file)
@@ -1,5 +1,6 @@
 #ident "$Header$"
 
+#include <stdio.h>
 #include <sys/types.h>
 #include <sys/time.h>
 #include <sys/resource.h>
@@ -11,6 +12,7 @@
 #include <unistd.h> 
 #include <string.h>
 #include <getopt.h>
+#include <errno.h>
 
 #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);
 }
index 6bbc328..bca275c 100644 (file)
@@ -1,5 +1,6 @@
 #ident "$Header$"
 
+#include <stdio.h>
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/un.h>
@@ -9,6 +10,8 @@
 #include <string.h>
 #include <syslog.h>
 #include <fcntl.h>
+#include <stdarg.h>
+#include <errno.h>
 
 #include "glite/lb/context-int.h"
 #include "glite/lb/escape.h"
index ed31186..0c532a9 100644 (file)
@@ -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");
                        }
index 6a98039..c9833a4 100644 (file)
@@ -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
   }