From: Zbigniew Jędrzejewski-Szmek Date: Sat, 9 Apr 2016 01:09:06 +0000 (-0400) Subject: nspawn: ignore failure to chdir X-Git-Tag: v230~194^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d929b0f98bf2c3b1698f760799a1999b878724f6;p=thirdparty%2Fsystemd.git nspawn: ignore failure to chdir CID #1322380. --- diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c index eb89916b7e1..c96a04cd5e6 100644 --- a/src/nspawn/nspawn.c +++ b/src/nspawn/nspawn.c @@ -2648,7 +2648,8 @@ static int inner_child( execvpe(arg_parameters[0], arg_parameters, env_use); else { if (!arg_chdir) - chdir(home ?: "/root"); + /* If we cannot change the directory, we'll end up in /, that is expected. */ + (void) chdir(home ?: "/root"); execle("/bin/bash", "-bash", NULL, env_use); execle("/bin/sh", "-sh", NULL, env_use);