From: Mike Yuan Date: Wed, 4 Sep 2024 16:16:51 +0000 (+0200) Subject: core/namespace: add comment to explain the non-obvious assumption on /run/systemd... X-Git-Tag: v257-rc1~553^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cc4f736ae37909570535c71d1f237f21328adaa5;p=thirdparty%2Fsystemd.git core/namespace: add comment to explain the non-obvious assumption on /run/systemd/journal/ Follow-up for 119820f8abf587f96a11fb1f28ef854e84bc3122 Addresses https://github.com/systemd/systemd/pull/32487#discussion_r1743493196 --- diff --git a/src/core/namespace.c b/src/core/namespace.c index 026018438c8..a38bad14742 100644 --- a/src/core/namespace.c +++ b/src/core/namespace.c @@ -1148,6 +1148,8 @@ static int mount_private_dev(const MountEntry *m, const NamespaceParameters *p) FOREACH_STRING(d, "/dev/mqueue", "/dev/hugepages") (void) bind_mount_device_dir(temporary_mount, d); + /* We assume /run/systemd/journal/ is available if not changing root, which isn't entirely accurate + * but shouldn't matter, as either way the user would get ENOENT when accessing /dev/log */ if ((!p->root_image && !p->root_directory) || p->bind_journal_sockets) { const char *devlog = strjoina(temporary_mount, "/dev/log"); if (symlink("/run/systemd/journal/dev-log", devlog) < 0)