Skip to content
Snippets Groups Projects
Commit 7cdaee6f authored by Moe Jette's avatar Moe Jette
Browse files

Fix overwriting of env vars in jobcomp/script (losing UID and JOBID).

parent 64c98fcc
No related branches found
No related tags found
No related merge requests found
......@@ -178,14 +178,17 @@ static char ** _create_environment(char *job, char *user, char *job_name,
len += strlen(node_list)+7;
len += strlen(submit)+7;
len += strlen(batch)+6;
/* Add new entries here as need and increase ENV_COUNT */
#define ENV_COUNT 13
#ifdef _PATH_STDPATH
len += strlen(_PATH_STDPATH)+6;
#endif
len += (13*sizeof(char *));
len += (ENV_COUNT * sizeof(char *));
if(!(envptr = (char **)try_xmalloc(len))) return NULL;
if(!(envptr = (char **)try_xmalloc(len)))
return NULL;
ptr = (char *)envptr + (11*sizeof(char *));
ptr = (char *)envptr + (ENV_COUNT * sizeof(char *));
envptr[0] = ptr;
memcpy(ptr,"JOBID=",6);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment