]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
lxc/conf: support nosymfollow mount flag
authorAlexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
Mon, 5 May 2025 16:01:38 +0000 (18:01 +0200)
committerAlexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
Sat, 10 May 2025 11:41:08 +0000 (13:41 +0200)
Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
src/lxc/conf.c
src/lxc/macro.h
src/lxc/mount_utils.h

index a01b0852d1b9ec52d01a8aeebc6a9190f632e872..9c95cd020f807437dfd5049bfabf55e049df018a 100644 (file)
@@ -140,6 +140,7 @@ static struct mount_opt mount_opt[] = {
        { "noexec",        0, false, MOUNT_ATTR_NOEXEC,      MS_NOEXEC        },
        { "norelatime",    1, false, MOUNT_ATTR_RELATIME,    MS_RELATIME      },
        { "nostrictatime", 1, false, MOUNT_ATTR_STRICTATIME, MS_STRICTATIME   },
+       { "nosymfollow",   0, false, MOUNT_ATTR_NOSYMFOLLOW, MS_NOSYMFOLLOW   },
        { "nosuid",        0, false, MOUNT_ATTR_NOSUID,      MS_NOSUID        },
        { "relatime",      0, false, MOUNT_ATTR_RELATIME,    MS_RELATIME      },
        { "ro",            0, false, MOUNT_ATTR_RDONLY,      MS_RDONLY        },
index 58e3a7f25a0db492f59fe6b60e2b79d50d476368..ae984c1fe147fd247c10670b30af35e4e7631656 100644 (file)
@@ -626,6 +626,10 @@ enum {
 #define MS_REC 16384
 #endif
 
+#ifndef MS_NOSYMFOLLOW
+#define MS_NOSYMFOLLOW 256     /* Do not follow symlinks */
+#endif
+
 /* open */
 #ifndef O_PATH
 #define O_PATH      010000000
index a76f7bd1ff54acdf878b78839203d4c18925ec23..d616b6e6d61ee2ad5689642fd165a24931469b1a 100644 (file)
@@ -176,6 +176,10 @@ struct lxc_rootfs;
 #define MOUNT_ATTR_IDMAP 0x00100000
 #endif
 
+#ifndef MOUNT_ATTR_NOSYMFOLLOW
+#define MOUNT_ATTR_NOSYMFOLLOW 0x00200000 /* Do not follow symlinks */
+#endif
+
 #if !HAVE_MOVE_MOUNT
 static inline int move_mount_lxc(int from_dfd, const char *from_pathname,
                                 int to_dfd, const char *to_pathname,