summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-02-12 18:58:43 +0100
committerLennart Poettering <lennart@poettering.net>2015-02-12 18:58:43 +0100
commitcf1d0302aeaf4e44a6a643fb41e5525fdd04b1d5 (patch)
treebd2528dedf852a3466d321aee82de6ca1b27eec0
parent615aaf412c441e67c7cad2e5ae966b03fca1fae7 (diff)
exec: also evaluate working_directory_missing_ok when not applying chroots
-rw-r--r--src/core/execute.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/core/execute.c b/src/core/execute.c
index 1f6072c6ab..340b8000d4 100644
--- a/src/core/execute.c
+++ b/src/core/execute.c
@@ -1626,13 +1626,14 @@ static int exec_child(
_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) {
*exit_status = EXIT_MEMORY;
return -ENOMEM;
}
- if (chdir(d) < 0) {
+ if (chdir(d) < 0 &&
+ !context->working_directory_missing_ok) {
*exit_status = EXIT_CHDIR;
return -errno;
}