exec: also evaluate working_directory_missing_ok when not applying chroots

(cherry picked from commit cf1d0302ae)

Conflicts:
	src/core/execute.c
This commit is contained in:
Lennart Poettering
2015-03-23 02:13:01 -04:00
committed by Zbigniew Jędrzejewski-Szmek
parent 32283b968a
commit 5e0da7f600
+4 -3
View File
@@ -1609,13 +1609,14 @@ static int exec_child(ExecCommand *command,
_cleanup_free_ char *d = NULL;
if (asprintf(&d, "%s/%s",
context->root_directory ? context->root_directory : "",
context->working_directory ? context->working_directory : "") < 0) {
context->root_directory ?: "",
context->working_directory ?: "") < 0) {
*error = EXIT_MEMORY;
return -ENOMEM;
}
if (chdir(d) < 0) {
if (chdir(d) < 0 &&
!context->working_directory_missing_ok) {
*error = EXIT_CHDIR;
return -errno;
}