Stéphane Graber has proposed merging lp:~stgraber/upstart/upstart-shell-exec
into lp:upstart.
Requested reviews:
Upstart Reviewers (upstart-reviewers)
For more details, see:
https://code.launchpad.net/~stgraber/upstart/upstart-shell-exec/+merge/140233
This should hopefully fix the job_process test for good.
The previous change was setting job->script = TRUE whenever shell syntax was
found on the command line. Sadly this was causing the code to then go through
a different code path and skip prepending "exec" to the shell command line.
This ultimately was causing a test to hang when run in a directory containing
shell syntax in its path.
The fix reverts that change and instead always sets script = TRUE but only at
the very end of the processing, so the code path doesn't change but the
property is still properly set so tests can use it.
--
https://code.launchpad.net/~stgraber/upstart/upstart-shell-exec/+merge/140233
Your team Upstart Reviewers is requested to review the proposed merge of
lp:~stgraber/upstart/upstart-shell-exec into lp:upstart.
=== modified file 'init/job_process.c'
--- init/job_process.c 2012-12-17 11:36:46 +0000
+++ init/job_process.c 2012-12-17 15:45:25 +0000
@@ -178,18 +178,11 @@
nih_assert (proc != NULL);
nih_assert (proc->command != NULL);
-
- /* If the command string contains any shell-like characters,
- * automatically set script = TRUE since that's the best way to deal
- * with things like variables.
- */
- if (strpbrk (proc->command, SHELL_CHARS))
- proc->script = TRUE;
-
/* We run the process using a shell if it says it wants to be run
- * as such.
+ * as such, or if it contains any shell-like characters; since that's
+ * the best way to deal with things like variables.
*/
- if (proc->script) {
+ if ((proc->script) || strpbrk (proc->command, SHELL_CHARS)) {
char *nl, *p;
argc = 0;
@@ -246,6 +239,12 @@
NIH_MUST (nih_str_array_addp (&argv, NULL,
&argc, cmd));
}
+
+ /* At the end, always set proc->script to TRUE, even if the user didn't
+ * explicitly set it (when using shell variables). That way tests and
+ * can reliably check for shell-specific behaviour.
+ */
+ proc->script = TRUE;
} else {
/* Split the command on whitespace to produce a list of
* arguments that we can exec directly.
--
upstart-devel mailing list
[email protected]
Modify settings or unsubscribe at:
https://lists.ubuntu.com/mailman/listinfo/upstart-devel