Skip to content

Commit

Permalink
Make blahp be permissive of proxies with relative paths. Also fixed u…
Browse files Browse the repository at this point in the history
…pstream in the gridmanager. Corresponds to blahp-relative-proxypath.patch from the OSG distribution.
  • Loading branch information
bbockelm committed Dec 13, 2012
1 parent 163b0ed commit dbbfd62
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -1031,6 +1031,7 @@ cmd_submit_job(void *args)
char *error_string;
int res = 1;
char *proxyname = NULL;
char *iwd = NULL;
char *proxysubject = NULL;
char *proxyfqan = NULL;
char *proxynameNew = NULL;
Expand Down Expand Up @@ -1091,6 +1092,30 @@ cmd_submit_job(void *args)
proxyname = NULL;
}
}
/* If the proxy is a relative path, we must prepend the Iwd to make it absolute */
if (proxyname && proxyname[0] != '/') {
if (classad_get_dstring_attribute(cad, "Iwd", &iwd) == C_CLASSAD_NO_ERROR) {
size_t iwdlen = strlen(iwd);
size_t proxylen = iwdlen + strlen(proxyname) + 1;
char *proxynameTmp;
proxynameTmp = malloc(proxylen + 1);
if (!proxynameTmp) {
resultLine = make_message("%s 1 Malloc\\ failure N/A", reqId);
goto cleanup_lrms;
}
memcpy(proxynameTmp, iwd, iwdlen);
proxynameTmp[iwdlen] = '/';
strcpy(proxynameTmp+iwdlen+1, proxyname);
free(proxyname);
free(iwd);
iwd = NULL;
proxyname = proxynameTmp;
proxynameTmp = NULL;
} else {
resultLine = make_message("%s 1 Relative\\ x509UserProxy\\ specified\\ without\\ Iwd N/A", reqId);
goto cleanup_lrms;
}
}

/* If there are additional arguments, we have to map on a different id */
if(argv[CMD_SUBMIT_JOB_ARGS + 1] != NULL)
Expand Down

0 comments on commit dbbfd62

Please sign in to comment.