Use _PATH_BSHELL to ensure using a bourne shell
[Michael] This commit should fix problems with people using a non-bourne shell as login shell, e.g. fish or rc. AFAICT, $SHELL should only be used for interactive shells, but we just want a bourne shell, not an interactive shell.
This commit is contained in:
committed by
Michael Stapelberg
parent
857fc0bf17
commit
f691a55923
@ -22,6 +22,7 @@
|
||||
#include <yajl/yajl_parse.h>
|
||||
#include <yajl/yajl_version.h>
|
||||
#include <yajl/yajl_gen.h>
|
||||
#include <paths.h>
|
||||
|
||||
#include "common.h"
|
||||
|
||||
@ -423,12 +424,7 @@ void start_child(char *command) {
|
||||
dup2(pipe_in[1], STDOUT_FILENO);
|
||||
dup2(pipe_out[0], STDIN_FILENO);
|
||||
|
||||
static const char *shell = NULL;
|
||||
|
||||
if ((shell = getenv("SHELL")) == NULL)
|
||||
shell = "/bin/sh";
|
||||
|
||||
execl(shell, shell, "-c", command, (char*) NULL);
|
||||
execl(_PATH_BSHELL, _PATH_BSHELL, "-c", command, (char*) NULL);
|
||||
return;
|
||||
default:
|
||||
/* Parent-process. Reroute streams */
|
||||
|
Reference in New Issue
Block a user