From: Lennart Poettering Date: Fri, 7 Feb 2025 13:32:44 +0000 (+0100) Subject: catalog: assign a proper message ID for mounts on symlinked paths X-Git-Tag: v258-rc1~1299^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=66b5e7dfaa85df938811a34732f50ec708a9ae11;p=thirdparty%2Fsystemd.git catalog: assign a proper message ID for mounts on symlinked paths For some reason we reused the non-empty catalog entry so far, which is plain wrong. Correct that. --- diff --git a/catalog/systemd.catalog.in b/catalog/systemd.catalog.in index f3ca7488627..801bda09395 100644 --- a/catalog/systemd.catalog.in +++ b/catalog/systemd.catalog.in @@ -460,6 +460,18 @@ this directory become inaccessible. To see those over-mounted files, please manually mount the underlying file system to a secondary location. +-- 1edabb4eda2a49c19bc0206f24b43889 +Subject: Mount point path contains symlinks +Defined-By: systemd +Support: %SUPPORT_URL% + +The path @WHERE@ is specified as a mount point path (second field in /etc/fstab +or Where= field in systemd unit file) and is not canonical, i.e. contains one +or more symlinks as path elements. This is generally not supported and such +mount attempts are refused, because the mount table information exposed by the +kernel and the requested path would deviate once established. Please +canonicalize paths before requesting a mount to be established. + -- 24d8d4452573402496068381a6312df2 Subject: A virtual machine or container has been started Defined-By: systemd diff --git a/src/core/unit.c b/src/core/unit.c index 91608766351..b784342c089 100644 --- a/src/core/unit.c +++ b/src/core/unit.c @@ -5131,7 +5131,7 @@ int unit_log_noncanonical_mount_path(Unit *u, const char *where) { /* No need to mention "." or "..", they would already have been rejected by unit_name_from_path() */ log_unit_struct(u, LOG_ERR, - "MESSAGE_ID=" SD_MESSAGE_OVERMOUNTING_STR, + "MESSAGE_ID=" SD_MESSAGE_NON_CANONICAL_MOUNT_STR, LOG_UNIT_INVOCATION_ID(u), LOG_UNIT_MESSAGE(u, "Mount path %s is not canonical (contains a symlink).", where), "WHERE=%s", where); diff --git a/src/systemd/sd-messages.h b/src/systemd/sd-messages.h index 441f4e6888e..cc30add2007 100644 --- a/src/systemd/sd-messages.h +++ b/src/systemd/sd-messages.h @@ -190,6 +190,8 @@ _SD_BEGIN_DECLARATIONS; #define SD_MESSAGE_OVERMOUNTING SD_ID128_MAKE(1d,ee,03,69,c7,fc,47,36,b7,09,9b,38,ec,b4,6e,e7) #define SD_MESSAGE_OVERMOUNTING_STR SD_ID128_MAKE_STR(1d,ee,03,69,c7,fc,47,36,b7,09,9b,38,ec,b4,6e,e7) +#define SD_MESSAGE_NON_CANONICAL_MOUNT SD_ID128_MAKE(1e,da,bb,4e,da,2a,49,c1,9b,c0,20,6f,24,b4,38,89) +#define SD_MESSAGE_NON_CANONICAL_MOUNT_STR SD_ID128_MAKE_STR(1e,da,bb,4e,da,2a,49,c1,9b,c0,20,6f,24,b4,38,89) #define SD_MESSAGE_UNIT_OOMD_KILL SD_ID128_MAKE(d9,89,61,1b,15,e4,4c,9d,bf,31,e3,c8,12,56,e4,ed) #define SD_MESSAGE_UNIT_OOMD_KILL_STR SD_ID128_MAKE_STR(d9,89,61,1b,15,e4,4c,9d,bf,31,e3,c8,12,56,e4,ed)