diff --git a/sdk_container/src/third_party/coreos-overlay/sys-apps/systemd/files/211-0001-nspawn-allow-EEXIST-on-mkdir_safe-home-uid.patch b/sdk_container/src/third_party/coreos-overlay/sys-apps/systemd/files/211-0001-nspawn-allow-EEXIST-on-mkdir_safe-home-uid.patch new file mode 100644 index 0000000000..856dde869c --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/sys-apps/systemd/files/211-0001-nspawn-allow-EEXIST-on-mkdir_safe-home-uid.patch @@ -0,0 +1,28 @@ +From aca07d5e53da1970b31907fc07237800424e84f1 Mon Sep 17 00:00:00 2001 +From: Brandon Philips +Date: Thu, 13 Mar 2014 15:19:40 -0700 +Subject: [PATCH] nspawn: allow -EEXIST on mkdir_safe /home/${uid} + +With systemd 211 nspawn attempts to create the home directory for the +given uid. However, if the home directory already exists then it will +fail. Don't error out on -EEXIST. +--- + src/nspawn/nspawn.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c +index b637b51..7c3d7b8 100644 +--- a/src/nspawn/nspawn.c ++++ b/src/nspawn/nspawn.c +@@ -2543,7 +2543,7 @@ static int change_uid_gid(char **_home) { + } + + r = mkdir_safe(home, 0755, uid, gid); +- if (r < 0) { ++ if (r < 0 && r != -EEXIST) { + log_error("Failed to make home directory: %s", strerror(-r)); + return r; + } +-- +1.8.5.2 (Apple Git-48) + diff --git a/sdk_container/src/third_party/coreos-overlay/sys-apps/systemd/systemd-211-r1.ebuild b/sdk_container/src/third_party/coreos-overlay/sys-apps/systemd/systemd-211-r1.ebuild index c48f056633..d7770e34d2 100644 --- a/sdk_container/src/third_party/coreos-overlay/sys-apps/systemd/systemd-211-r1.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/sys-apps/systemd/systemd-211-r1.ebuild @@ -110,6 +110,7 @@ src_prepare() { # upstream fixes not yet in the release epatch "${FILESDIR}"/211-tmpfiles.patch + epatch "${FILESDIR}"/211-0001-nspawn-allow-EEXIST-on-mkdir_safe-home-uid.patch if [[ ${PV} == *9999 ]]; then if use doc; then