From: Michal Voců Date: Thu, 23 Aug 2012 13:31:05 +0000 (+0000) Subject: added parameter to indicate type of credentials to acquire X-Git-Tag: glite-jobid-api-c_R_2_2_2_1~15 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=78fc5e896fd2574a0ad80fc80e372bbffea54f58;p=jra1mw.git added parameter to indicate type of credentials to acquire --- diff --git a/org.glite.lb.client/src/connection.c b/org.glite.lb.client/src/connection.c index 45ba4e7..2b63460 100644 --- a/org.glite.lb.client/src/connection.c +++ b/org.glite.lb.client/src/connection.c @@ -361,9 +361,10 @@ int edg_wll_open(edg_wll_Context ctx, int* connToUse) if (acquire_cred) { edg_wll_GssCred newcred = NULL; - if (edg_wll_gss_acquire_cred_gsi( + if (edg_wll_gss_acquire_cred( ctx->p_proxy_filename ? ctx->p_proxy_filename : ctx->p_cert_filename, ctx->p_proxy_filename ? ctx->p_proxy_filename : ctx->p_key_filename, + GSS_C_INITIATE, &newcred, &gss_stat)) { edg_wll_SetErrorGss(ctx, "failed to load GSI credentials", &gss_stat); goto err; @@ -749,9 +750,10 @@ int edg_wll_accept(edg_wll_Context ctx, int fd) if (acquire_cred) { edg_wll_GssCred newcred = NULL; - if (edg_wll_gss_acquire_cred_gsi( + if (edg_wll_gss_acquire_cred( ctx->p_proxy_filename ? ctx->p_proxy_filename : ctx->p_cert_filename, ctx->p_proxy_filename ? ctx->p_proxy_filename : ctx->p_key_filename, + GSS_C_ACCEPT, &newcred, &gss_stat)) { edg_wll_SetErrorGss(ctx, "failed to load GSI credentials", &gss_stat); goto err; diff --git a/org.glite.lb.client/src/notify.c b/org.glite.lb.client/src/notify.c index 220d4e6..6a1c517 100644 --- a/org.glite.lb.client/src/notify.c +++ b/org.glite.lb.client/src/notify.c @@ -224,7 +224,7 @@ int main(int argc,char **argv) break; case 'O': if (excl) { usage("new"); return EX_USAGE; } else excl = 1; - if ( !edg_wll_gss_acquire_cred_gsi(NULL, NULL, &mycred, &gss_code) ) + if ( !edg_wll_gss_acquire_cred(NULL, NULL, GSS_C_INITIATE, &mycred, &gss_code) ) { conditions[i] = (edg_wll_QueryRec *)calloc(2,sizeof(edg_wll_QueryRec)); conditions[i][0].attr = EDG_WLL_QUERY_ATTR_OWNER; diff --git a/org.glite.lb.client/src/prod_proto.c b/org.glite.lb.client/src/prod_proto.c index ce8142a..c2dc6fc 100644 --- a/org.glite.lb.client/src/prod_proto.c +++ b/org.glite.lb.client/src/prod_proto.c @@ -275,9 +275,10 @@ int edg_wll_log_connect(edg_wll_Context ctx, int *conn) edg_wll_poolUnlock(); /* acquire gss credentials */ - ret = edg_wll_gss_acquire_cred_gsi( + ret = edg_wll_gss_acquire_cred( ctx->p_proxy_filename ? ctx->p_proxy_filename : ctx->p_cert_filename, ctx->p_proxy_filename ? ctx->p_proxy_filename : ctx->p_key_filename, + GSS_C_INITIATE, &ctx->connections->connPool[index].gsiCred, &gss_stat); /* give up if unable to acquire prescribed credentials, otherwise go on anonymously */ if (ret && ctx->p_proxy_filename) { @@ -305,9 +306,10 @@ int edg_wll_log_connect(edg_wll_Context ctx, int *conn) int opt; /* acquire gss credentials */ - ret = edg_wll_gss_acquire_cred_gsi( + ret = edg_wll_gss_acquire_cred( ctx->p_proxy_filename ? ctx->p_proxy_filename : ctx->p_cert_filename, ctx->p_proxy_filename ? ctx->p_proxy_filename : ctx->p_key_filename, + GSS_C_INITIATE, &ctx->connections->connPool[index].gsiCred, &gss_stat); /* give up if unable to acquire prescribed credentials, otherwise go on anonymously */ @@ -707,9 +709,10 @@ int edg_wll_log_direct_connect(edg_wll_Context ctx, edg_wll_GssConnection *conn) edg_wlc_JobIdGetServerParts(ctx->p_jobid,&host,&port); port +=1; /* acquire gss credentials */ - ret = edg_wll_gss_acquire_cred_gsi( + ret = edg_wll_gss_acquire_cred( ctx->p_proxy_filename ? ctx->p_proxy_filename : ctx->p_cert_filename, ctx->p_proxy_filename ? ctx->p_proxy_filename : ctx->p_key_filename, + GSS_C_INITIATE, &cred, &gss_stat); /* give up if unable to acquire prescribed credentials, otherwise go on anonymously */ if (ret && ctx->p_proxy_filename) { diff --git a/org.glite.lb.client/src/producer.c b/org.glite.lb.client/src/producer.c index 2da0dc3..b422d64 100644 --- a/org.glite.lb.client/src/producer.c +++ b/org.glite.lb.client/src/producer.c @@ -720,6 +720,7 @@ static int edg_wll_SetLoggingJobMaster( err = edg_wll_gss_acquire_cred( ctx->p_proxy_filename ? ctx->p_proxy_filename : ctx->p_cert_filename, ctx->p_proxy_filename ? ctx->p_proxy_filename : ctx->p_key_filename, + GSS_C_INITIATE, &cred, &gss_stat); /* give up if unable to acquire prescribed credentials */ if (err) { diff --git a/org.glite.lb.logger/src/interlogd.c b/org.glite.lb.logger/src/interlogd.c index 9ffeed6..2d2b590 100644 --- a/org.glite.lb.logger/src/interlogd.c +++ b/org.glite.lb.logger/src/interlogd.c @@ -526,7 +526,7 @@ main (int argc, char **argv) } cred_handle->creds = NULL; cred_handle->counter = 0; - ret = edg_wll_gss_acquire_cred_gsi(cert_file, key_file, &cred_handle->creds, &gss_stat); + ret = edg_wll_gss_acquire_cred(cert_file, key_file, GSS_C_INITIATE, &cred_handle->creds, &gss_stat); if (ret) { char *gss_err = NULL; diff --git a/org.glite.lb.logger/src/logd.c b/org.glite.lb.logger/src/logd.c index 03490c1..8a81197 100644 --- a/org.glite.lb.logger/src/logd.c +++ b/org.glite.lb.logger/src/logd.c @@ -461,7 +461,7 @@ This is LocalLogger, part of Workload Management System in EU DataGrid & EGEE.\n 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); + ret = edg_wll_gss_acquire_cred(cert_file, key_file, GSS_C_ACCEPT, &cred, &gss_stat); if (ret) { /* XXX DK: call edg_wll_gss_get_error() */ glite_common_log(LOG_CATEGORY_CONTROL,LOG_PRIORITY_FATAL,"Failed to get GSI credentials. Exiting.\n"); @@ -585,7 +585,7 @@ This is LocalLogger, part of Workload Management System in EU DataGrid & EGEE.\n edg_wll_GssCred newcred; case 0: break; case 1: - ret = edg_wll_gss_acquire_cred_gsi(cert_file,key_file,&newcred,&gss_stat); + ret = edg_wll_gss_acquire_cred(cert_file,key_file,GSS_C_ACCEPT, &newcred,&gss_stat); if (ret) { glite_common_log(LOG_CATEGORY_SECURITY,LOG_PRIORITY_WARN,"Reloading credentials failed, continue with older\n"); } else { diff --git a/org.glite.lb.logger/src/recover.c b/org.glite.lb.logger/src/recover.c index b4bf988..259d77e 100644 --- a/org.glite.lb.logger/src/recover.c +++ b/org.glite.lb.logger/src/recover.c @@ -62,7 +62,7 @@ recover_thread(void *q) edg_wll_GssCred new_creds = NULL; int int_ret; - int_ret = edg_wll_gss_acquire_cred_gsi(cert_file,key_file, + int_ret = edg_wll_gss_acquire_cred(cert_file,key_file, GSS_C_INITIATE, &new_creds, NULL); if (new_creds != NULL) { if(pthread_mutex_lock(&cred_handle_lock) < 0) diff --git a/org.glite.lb.server/src/bkserverd.c b/org.glite.lb.server/src/bkserverd.c index 30d430c..9028035 100644 --- a/org.glite.lb.server/src/bkserverd.c +++ b/org.glite.lb.server/src/bkserverd.c @@ -701,7 +701,7 @@ int main(int argc, char *argv[]) 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) && mycred->name != NULL) + if ( !edg_wll_gss_acquire_cred(server_cert, server_key, GSS_C_ACCEPT, &mycred, &gss_code) && mycred->name != NULL) { glite_common_log(LOG_CATEGORY_CONTROL, LOG_PRIORITY_INFO, "Server identity: %s", mycred->name); server_subject = strdup(mycred->name); @@ -1028,7 +1028,7 @@ int bk_handle_connection(int conn, struct timeval *timeout, void *data) 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, &gss_code) ) { + if ( !edg_wll_gss_acquire_cred(server_cert, server_key, GSS_C_ACCEPT, &newcred, &gss_code) ) { glite_common_log(LOG_CATEGORY_SECURITY, LOG_PRIORITY_INFO, "[%d] reloading credentials successful", getpid()); edg_wll_gss_release_cred(&mycred, NULL); mycred = newcred; @@ -1041,7 +1041,7 @@ int bk_handle_connection(int conn, struct timeval *timeout, void *data) break; } #else - if ( !edg_wll_gss_acquire_cred_gsi(server_cert, server_key, &newcred, &gss_code) ) { + if ( !edg_wll_gss_acquire_cred(server_cert, server_key, GSS_C_ACCEPT, &newcred, &gss_code) ) { glite_common_log(LOG_CATEGORY_SECURITY, LOG_PRIORITY_INFO, "[%d] reloading credentials successful", getpid()); edg_wll_gss_release_cred(&mycred, NULL); mycred = newcred; diff --git a/org.glite.lbjp-common.gsoap-plugin/src/glite_gsplugin.c b/org.glite.lbjp-common.gsoap-plugin/src/glite_gsplugin.c index 81128f4..e5fc0e1 100644 --- a/org.glite.lbjp-common.gsoap-plugin/src/glite_gsplugin.c +++ b/org.glite.lbjp-common.gsoap-plugin/src/glite_gsplugin.c @@ -200,7 +200,7 @@ glite_gsplugin(struct soap *soap, struct soap_plugin *p, void *arg) free(pdata); return ENOMEM; } - if ( edg_wll_gss_acquire_cred_gsi(NULL, NULL, &pdata->ctx->cred, &gss_code) ) { + if ( edg_wll_gss_acquire_cred(NULL, NULL, GSS_C_ACCEPT, &pdata->ctx->cred, &gss_code) ) { /* XXX: Let user know, that cred. load failed. Somehow... */ glite_gsplugin_free_context(pdata->ctx); @@ -299,7 +299,7 @@ glite_gsplugin_connect( if ( ctx->cred == NULL ) { pdprintf(("GSLITE_GSPLUGIN: loading default credentials\n")); - ret = edg_wll_gss_acquire_cred_gsi(NULL, NULL, + ret = edg_wll_gss_acquire_cred(NULL, NULL, GSS_C_INITIATE, &ctx->cred, &gss_stat); if ( ret ) { msg = "failed to load GSI credentials";