/* 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.");
}
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) {
}
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;
}
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)
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
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);
}
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;
}