diff --git a/NEWS b/NEWS index 7d426f107917c32a4caaa1d531895195be25deb3..bc2e072f25a6a6107b2607a8a65e04cb71e2883d 100644 --- a/NEWS +++ b/NEWS @@ -244,7 +244,8 @@ documents those changes that are of interest to users and admins. and time limit where it was previously set by an admin. -- Fix issue where log message is more than 256 chars and then has a format. -- Fix sched/wiki2 to support job account name, gres, partition name, wckey, - or working directory that contains "#" (a job record separator). + or working directory that contains "#" (a job record separator). Also fix + for wckey or working directory that contains a double quote '\"'. -- CRAY - fix for handling memory requests from user for an allocation. -- Add support for switches parameter to the job_submit/lua plugin. Work by Par Andersson, NSC. diff --git a/src/plugins/sched/wiki2/get_jobs.c b/src/plugins/sched/wiki2/get_jobs.c index 1632e187d9227da179bd8106558bb557a25c1bfb..3e004d5f431c91b52635225626bd2f77b04168d9 100644 --- a/src/plugins/sched/wiki2/get_jobs.c +++ b/src/plugins/sched/wiki2/get_jobs.c @@ -326,8 +326,16 @@ static char * _dump_job(struct job_record *job_ptr, time_t update_time) if (!IS_JOB_FINISHED(job_ptr) && job_ptr->details && job_ptr->details->work_dir) { - snprintf(tmp, sizeof(tmp), "IWD=\"%s\";", - job_ptr->details->work_dir); + if ((quote = strchr(job_ptr->details->work_dir, (int) '\"'))) { + /* Moab does not like strings containing a quote */ + *quote = '\0'; + snprintf(tmp, sizeof(tmp), "IWD=\"%s\";", + job_ptr->details->work_dir); + *quote = '\"'; + } else { + snprintf(tmp, sizeof(tmp), "IWD=\"%s\";", + job_ptr->details->work_dir); + } xstrcat(buf, tmp); } @@ -340,7 +348,17 @@ static char * _dump_job(struct job_record *job_ptr, time_t update_time) } if (job_ptr->wckey) { - snprintf(tmp, sizeof(tmp),"WCKEY=\"%s\";", job_ptr->wckey); + if ((quote = strchr(job_ptr->wckey, (int) '\"'))) { + /* Moab does not like strings containing a quote */ + *quote = '\0'; + snprintf(tmp, sizeof(tmp), + "WCKEY=\"%s\";", job_ptr->wckey); + *quote = '\"'; + xstrcat(buf, tmp); + } else { + snprintf(tmp, sizeof(tmp), + "WCKEY=\"%s\";", job_ptr->wckey); + } xstrcat(buf, tmp); }