Skip to content

Commit

Permalink
mxqd: Do not execute invalid job.argv_str commands.
Browse files Browse the repository at this point in the history
This fixes issue #13
  • Loading branch information
mariux committed Jun 16, 2015
1 parent f3d826b commit b6ef9fa
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion mxqd.c
Original file line number Diff line number Diff line change
Expand Up @@ -960,7 +960,14 @@ 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,
Expand Down

0 comments on commit b6ef9fa

Please sign in to comment.