From: Daniel KouĊ™il Date: Thu, 9 Mar 2006 11:23:47 +0000 (+0000) Subject: Added edg_wlpr_RegisterProxyJobId not depending on wms-utils X-Git-Tag: glite-jp-index_R_1_2_0~4 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=7f1a8dd5269ae2904a0380fc2d717c0b659be460;p=jra1mw.git Added edg_wlpr_RegisterProxyJobId not depending on wms-utils --- diff --git a/org.glite.security.proxyrenewal/interface/renewal.h b/org.glite.security.proxyrenewal/interface/renewal.h index 953ab0e..aa52e2a 100644 --- a/org.glite.security.proxyrenewal/interface/renewal.h +++ b/org.glite.security.proxyrenewal/interface/renewal.h @@ -86,6 +86,16 @@ edg_wlpr_RegisterProxyExt( char ** repository_filename ); +int +edg_wlpr_RegisterProxyJobId( + const char * filename, + const char * server, + unsigned int port, + const char *jobid, + int flags, + char ** repository_filename +); + /** * Unregister proxy from the renewal daemon. * \param jobid IN: specification of job whose proxy shall be unregistered diff --git a/org.glite.security.proxyrenewal/src/api.c b/org.glite.security.proxyrenewal/src/api.c index 922931b..6d3b0b2 100644 --- a/org.glite.security.proxyrenewal/src/api.c +++ b/org.glite.security.proxyrenewal/src/api.c @@ -330,10 +330,10 @@ edg_wlpr_RequestSend(edg_wlpr_Request *request, edg_wlpr_Response *response) } int -edg_wlpr_RegisterProxyExt(const char *filename, const char * server, - unsigned int port, - edg_wlc_JobId jobid, int flags, - char **repository_filename) +edg_wlpr_RegisterProxyJobId(const char *filename, const char * server, + unsigned int port, + const char *jobid, int flags, + char **repository_filename) { edg_wlpr_Request request; edg_wlpr_Response response; @@ -342,12 +342,15 @@ edg_wlpr_RegisterProxyExt(const char *filename, const char * server, memset(&request, 0, sizeof(request)); memset(&response, 0, sizeof(response)); + if (jobid == NULL) + return EINVAL; + request.command = EDG_WLPR_COMMAND_REG; request.myproxy_server = server; request.proxy_filename = filename; - request.jobid = edg_wlc_JobIdUnparse(jobid); + request.jobid = strdup(jobid); if (request.jobid == NULL) - return EINVAL; /* XXX */ + return ENOMEM; ret = edg_wlpr_RequestSend(&request, &response); free(request.jobid); @@ -364,6 +367,25 @@ edg_wlpr_RegisterProxyExt(const char *filename, const char * server, } int +edg_wlpr_RegisterProxyExt(const char *filename, const char * server, + unsigned int port, + edg_wlc_JobId jobid, int flags, + char **repository_filename) +{ + char *ji; + int ret; + + ji = edg_wlc_JobIdUnparse(jobid); + if (ji == NULL) + return EINVAL; + + ret = edg_wlpr_RegisterProxyJobId(filename, server, port, ji, flags, + repository_filename); + free(ji); + return ret; +} + +int edg_wlpr_RegisterProxy(const char *filename, const char *jdl, int flags, char **repository_filename) {