mirror of
https://github.com/systemd/systemd.git
synced 2024-10-27 10:25:37 +03:00
exec: also evaluate working_directory_missing_ok when not applying chroots
This commit is contained in:
parent
615aaf412c
commit
cf1d0302ae
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user