Merge branch 'obsd-master' into master

This commit is contained in:
Thomas Adam
2021-02-19 10:01:19 +00:00
2 changed files with 8 additions and 8 deletions

8
job.c
View File

@ -112,10 +112,10 @@ job_run(const char *cmd, struct session *s, const char *cwd,
proc_clear_signals(server_proc, 1);
sigprocmask(SIG_SETMASK, &oldset, NULL);
if (cwd == NULL || chdir(cwd) != 0) {
if ((home = find_home()) == NULL || chdir(home) != 0)
chdir("/");
}
if ((cwd == NULL || chdir(cwd) != 0) &&
((home = find_home()) == NULL || chdir(home) != 0) &&
chdir("/") != 0)
fatal("chdir failed");
environ_push(env);
environ_free(env);