]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
catalog: assign a proper message ID for mounts on symlinked paths
authorLennart Poettering <lennart@poettering.net>
Fri, 7 Feb 2025 13:32:44 +0000 (14:32 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 18 Feb 2025 12:49:24 +0000 (13:49 +0100)
For some reason we reused the non-empty catalog entry so far, which is
plain wrong. Correct that.

catalog/systemd.catalog.in
src/core/unit.c
src/systemd/sd-messages.h

index f3ca7488627b7e82f49d2e66f4cbdc273da2d978..801bda09395d83f27c23af83d6c774882a76aa4e 100644 (file)
@@ -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
index 9160876635128e52f3e3a6a8ce0d2dc460e4d33e..b784342c08908cec9b2877bc842cb9968227905a 100644 (file)
@@ -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);
index 441f4e6888ee108e25c017b4dc9544a06db38d56..cc30add20070d76d9b0d1843f16ffc604d6e0a5b 100644 (file)
@@ -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)