Skip to content

Commit

Permalink
Merge branch 'mxqd'
Browse files Browse the repository at this point in the history
* mxqd:
  mxqd: Fix exit codes in child process
  mxqd: Do not execute invalid job.argv_str commands.
  • Loading branch information
mariux committed Jun 16, 2015
2 parents f3d826b + 71fee8a commit 1468e63
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions mxqd.c
Original file line number Diff line number Diff line change
Expand Up @@ -938,7 +938,7 @@ unsigned long start_job(struct mxq_group_list *group)

res = init_child_process(group, &mxqjob);
if (!res)
exit(1);
_exit(EX__MAX + 1);

mxq_job_set_tmpfilenames(&group->group, &mxqjob);

Expand All @@ -960,12 +960,19 @@ unsigned long start_job(struct mxq_group_list *group)
}


char **argv = str_to_strvec(mxqjob.job_argv_str);
argv = str_to_strvec(mxqjob.job_argv_str);
if (!argv) {
mx_log_err("job=%s(%d):%lu:%lu Can't recaculate commandline. str_to_strvev(%s) failed: %m",
group->group.user_name, group->group.user_uid, group->group.group_id, mxqjob.job_id,
mxqjob.job_argv_str);
_exit(EX__MAX + 1);
}

execvp(argv[0], argv);
mx_log_err("job=%s(%d):%lu:%lu execvp(\"%s\", ...): %m",
group->group.user_name, group->group.user_uid, group->group.group_id, mxqjob.job_id,
argv[0]);
exit(1);
_exit(EX__MAX + 1);
}

gettimeofday(&mxqjob.stats_starttime, NULL);
Expand Down

0 comments on commit 1468e63

Please sign in to comment.