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

Permit sched/wiki2 (Moab) to set environment variables with quoted expressions

 as needed for included commans (e.g. "FOO="bar,none")
parent 55f2c101
No related branches found
No related tags found
No related merge requests found
...@@ -109,6 +109,41 @@ static int _job_modify(uint32_t jobid, char *bank_ptr, ...@@ -109,6 +109,41 @@ static int _job_modify(uint32_t jobid, char *bank_ptr,
return EINVAL; return EINVAL;
} }
have_equal = true; have_equal = true;
if (env_ptr[i+1] == '\"') {
for (i+=2; ; i++) {
if (env_ptr[i] == '\0') {
error("wiki: setting job %u "
"invalid environment "
"variables: %s",
jobid, env_ptr);
return EINVAL;
}
if (env_ptr[i] == '\"') {
i++;
break;
}
if (env_ptr[i] == '\\') {
i++;
}
}
} else if (env_ptr[i+1] == '\'') {
for (i+=2; ; i++) {
if (env_ptr[i] == '\0') {
error("wiki: setting job %u "
"invalid environment "
"variables: %s",
jobid, env_ptr);
return EINVAL;
}
if (env_ptr[i] == '\'') {
i++;
break;
}
if (env_ptr[i] == '\\') {
i++;
}
}
}
} }
if (isspace(env_ptr[i]) || (env_ptr[i] == ',')) { if (isspace(env_ptr[i]) || (env_ptr[i] == ',')) {
if (!have_equal) { if (!have_equal) {
......
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