interlogger now reports edg_wll_gss_watch_creds failures, savannah bug 84694 fixed
authorMarcel Poul <marcel.poul@cern.ch>
Sun, 11 Sep 2011 21:34:25 +0000 (21:34 +0000)
committerMarcel Poul <marcel.poul@cern.ch>
Sun, 11 Sep 2011 21:34:25 +0000 (21:34 +0000)
org.glite.lb.logger/src/interlogd.c
org.glite.lb.logger/src/logd.c
org.glite.lb.logger/src/recover.c
org.glite.lb.server/src/bkserverd.c

index 90a03d0..17d1046 100644 (file)
@@ -512,7 +512,9 @@ main (int argc, char **argv)
   /* get credentials */
   if (CAcert_dir)
      setenv("X509_CERT_DIR", CAcert_dir, 1);
-  edg_wll_gss_watch_creds(cert_file,&cert_mtime);
+  ret = edg_wll_gss_watch_creds(cert_file,&cert_mtime);
+  if (ret < 0)
+       glite_common_log(LOG_CATEGORY_SECURITY,LOG_PRIORITY_WARN,"edg_wll_gss_watch_creds failed, unable to access credentials\n");
   cred_handle = malloc(sizeof(*cred_handle));
   if(cred_handle == NULL) {
          glite_common_log(LOG_CATEGORY_CONTROL, LOG_PRIORITY_FATAL, "Failed to allocate structure for credentials.");
index 7a1d4ca..03490c1 100644 (file)
@@ -457,7 +457,9 @@ This is LocalLogger, part of Workload Management System in EU DataGrid & EGEE.\n
    }
 
    edg_wll_gss_initialize();
-   edg_wll_gss_watch_creds(cert_file,&cert_mtime);
+   ret = edg_wll_gss_watch_creds(cert_file,&cert_mtime);
+   if (ret < 0)
+       glite_common_log(LOG_CATEGORY_SECURITY,LOG_PRIORITY_WARN,"edg_wll_gss_watch_creds failed, unable to access credentials\n");
    /* XXX DK: support noAuth */
    ret = edg_wll_gss_acquire_cred_gsi(cert_file, key_file, &cred, &gss_stat);
    if (ret) {
@@ -593,7 +595,7 @@ This is LocalLogger, part of Workload Management System in EU DataGrid & EGEE.\n
                }
                break;
        case -1:
-               glite_common_log(LOG_CATEGORY_SECURITY,LOG_PRIORITY_WARN,"edg_wll_gss_watch_creds failed\n");
+               glite_common_log(LOG_CATEGORY_SECURITY,LOG_PRIORITY_WARN,"edg_wll_gss_watch_creds failed, unable to access credentials\n");
                break;
        }
 
index 20a9d9e..b4bf988 100644 (file)
@@ -56,11 +56,13 @@ recover_thread(void *q)
                        exit(1);
                }
                glite_common_log(LOG_CATEGORY_SECURITY, LOG_PRIORITY_DEBUG, "Checking for new certificate.");
-               if (edg_wll_gss_watch_creds(cert_file, &cert_mtime) > 0) {
+               int ret;
+               ret = edg_wll_gss_watch_creds(cert_file, &cert_mtime);
+               if (ret > 0) {
                        edg_wll_GssCred new_creds = NULL;
-                       int ret;
 
-                       ret = edg_wll_gss_acquire_cred_gsi(cert_file,key_file, 
+                       int int_ret;
+                       int_ret = edg_wll_gss_acquire_cred_gsi(cert_file,key_file, 
                                &new_creds, NULL);
                        if (new_creds != NULL) {
                                if(pthread_mutex_lock(&cred_handle_lock) < 0)
@@ -87,6 +89,9 @@ recover_thread(void *q)
                                                 new_creds->name);
                        }
                }
+               else if ( ret < 0)
+                       glite_common_log(LOG_CATEGORY_SECURITY,LOG_PRIORITY_WARN,"edg_wll_gss_watch_creds failed, unable to access credetials\n");
+               
 #ifndef LB_PERF
                sleep(RECOVER_TIMEOUT);
 #else
index f85a474..69de46c 100644 (file)
@@ -741,7 +741,10 @@ int main(int argc, char *argv[])
                        glite_common_log(LOG_CATEGORY_CONTROL, LOG_PRIORITY_WARN, "%s: key or certificate file not specified  - unable to watch them for changes!", argv[0]);
 
                if ( cadir ) setenv("X509_CERT_DIR", cadir, 1);
-               edg_wll_gss_watch_creds(server_cert, &cert_mtime);
+               int ret;
+               ret = edg_wll_gss_watch_creds(server_cert, &cert_mtime);
+               if (ret < 0)
+                       glite_common_log(LOG_CATEGORY_SECURITY,LOG_PRIORITY_WARN,"edg_wll_gss_watch_creds failed, unable to access credentials\n");
                if ( !edg_wll_gss_acquire_cred_gsi(server_cert, server_key, &mycred, &gss_code) )
                {
                        glite_common_log(LOG_CATEGORY_CONTROL, LOG_PRIORITY_INFO, "Server identity: %s", mycred->name);
@@ -1077,7 +1080,7 @@ int bk_handle_connection(int conn, struct timeval *timeout, void *data)
                }
                break;
        case -1: 
-               glite_common_log(LOG_CATEGORY_SECURITY, LOG_PRIORITY_ERROR, "[%d] edg_wll_gss_watch_creds failed", getpid());
+               glite_common_log(LOG_CATEGORY_SECURITY, LOG_PRIORITY_ERROR, "[%d] edg_wll_gss_watch_creds failed, unable to access credentials", getpid());
                break;
        }