static time_t notif_duration = 60*60*24*7;
static gss_cred_id_t mycred = GSS_C_NO_CREDENTIAL;
+time_t cert_mtime = 0;
char *cadir = NULL,
*vomsdir = NULL,
- *server_key = NULL,
- *server_cert = NULL;
+ *server_key = NULL,
+ *server_cert = NULL;
static struct option opts[] = {
" - unable to watch them for changes!\n", argv[0]);
if ( cadir ) setenv("X509_CERT_DIR", cadir, 1);
+ edg_wll_gss_watch_creds(server_cert, &cert_mtime);
if ( !edg_wll_gss_acquire_cred_gsi(server_cert, server_key, &mycred, &mysubj, &gss_code) )
{
int i;
edg_wll_Context ctx;
gss_name_t client_name = GSS_C_NO_NAME;
gss_buffer_desc token = GSS_C_EMPTY_BUFFER;
+ gss_cred_id_t newcred = GSS_C_NO_CREDENTIAL;
edg_wll_GssStatus gss_code;
OM_uint32 min_stat,
maj_stat;
+ switch ( edg_wll_gss_watch_creds(server_cert, &cert_mtime) ) {
+ case 0: break;
+ case 1:
+ if ( !edg_wll_gss_acquire_cred_gsi(server_cert, server_key, &newcred, NULL, &gss_code) ) {
+ dprintf(("[%d] reloading credentials\n", getpid()));
+ gss_release_cred(&min_stat, &mycred);
+ mycred = newcred;
+ } else { dprintf(("[%d] reloading credentials failed\n", getpid())); }
+ break;
+ case -1: dprintf(("[%d] edg_wll_gss_watch_creds failed\n", getpid())); break;
+ }
+
if ( edg_wll_InitContext(&ctx) )
{
fprintf(stderr, "Couldn't create context");
if ( !conditions || !conditions[0] ) {
if (ctx->noAuth) nconds_ct = jobs_ct = 0;
else return edg_wll_SetError(ctx, EINVAL, "Empty condition list");
- } else for ( nconds_ct = jobs_ct = i = 0; conditions[i]; i++ )
- {
+ }
+ else for ( nconds_ct = jobs_ct = i = 0; conditions[i]; i++ ) {
if ( conditions[i][0].attr && conditions[i][0].attr != EDG_WLL_QUERY_ATTR_JOBID )
nconds_ct++;
for ( j = 0; conditions[i][j].attr; j++ )
*/
}
- if ( host ) edg_wll_NotifChangeDestination(ctx, nid, host, port);
+ if ( host ) {
+ printf("edg_wll_NotifChangeDestination(ctx, %s, %s, %d)\n",
+ nid_s? nid_s: "nid", host, port);
+ if ( edg_wll_NotifChangeDestination(ctx, nid, host, port) ) {
+ char *errt, *errd;
+
+ edg_wll_Error(ctx, &errt, &errd);
+ printf("edg_wll_NotifChangeDestination(): %s (%s)\n", errt, errd);
+ free(errt);
+ free(errd);
+ }
+ }
cleanup:
return edg_wll_Error(ctx, NULL, NULL);
}
-
-