handle job kill while step prolog running

This prevents a step from being launched if the job is killed
while the prolog is running. Reproducing the original failure
requires use of srun to trigger the prolog and using scancel
while that prolog is running.
bug 1755
diff --git a/NEWS b/NEWS
index b34f7dc..00a7ba3 100644
--- a/NEWS
+++ b/NEWS
@@ -14,6 +14,7 @@
  -- Use the slurm_getpwuid_r wrapper of getpwuid_r to handle possible
     interrupts.
  -- Allow --ignore-pbs to take effect when read as an #SBATCH argument.
+ -- Do not launch step if job killed while the prolog was running.
 
 * Changes in Slurm 14.03.11
 ===========================
diff --git a/src/slurmd/slurmd/req.c b/src/slurmd/slurmd/req.c
index 9b91d88..f685704 100644
--- a/src/slurmd/slurmd/req.c
+++ b/src/slurmd/slurmd/req.c
@@ -1172,6 +1172,15 @@
 			errnum = ESLURMD_PROLOG_FAILED;
 			goto done;
 		}
+		/* Since the job could have been killed while the prolog was
+		 * running, test if the credential has since been revoked
+		 * and exit as needed. */
+		if (slurm_cred_revoked(conf->vctx, req->cred)) {
+			info("Job %u already killed, do not launch step %u.%u",
+			     req->job_id, req->job_id, req->job_step_id);
+			errnum = ESLURMD_CREDENTIAL_REVOKED;
+			goto done;
+		}
 	} else {
 		slurm_mutex_unlock(&prolog_mutex);
 		_wait_for_job_running_prolog(req->job_id);