Pass through nosymfollow mount option
authorTyler Hall <tylerwhall@gmail.com>
Sat, 27 Jul 2024 02:49:29 +0000 (22:49 -0400)
committerBernd Schubert <bernd.schubert@fastmail.fm>
Mon, 29 Jul 2024 08:59:22 +0000 (10:59 +0200)
This option is handled in VFS.

Added in Linux 5.10
dab741e0e02bd3c4f5e2e97be74b39df2523fc6e

Signed-off-by: Tyler Hall <tylerwhall@gmail.com>
lib/mount.c
util/fusermount.c

index 3fbbe72cf7ecd5b50e49f9a3d81ab26f3d11a1f0..aedd9b92eeb7e05b3d68d592eea0fd2a568f8283 100644 (file)
@@ -41,6 +41,7 @@
 #define MS_NOEXEC      MNT_NOEXEC
 #define MS_SYNCHRONOUS MNT_SYNCHRONOUS
 #define MS_NOATIME     MNT_NOATIME
+#define MS_NOSYMFOLLOW MNT_NOSYMFOLLOW
 
 #define umount2(mnt, flags) unmount(mnt, (flags == 2) ? MNT_FORCE : 0)
 #endif
@@ -114,6 +115,8 @@ static const struct fuse_opt fuse_mount_opts[] = {
        FUSE_OPT_KEY("noatime",                 KEY_KERN_FLAG),
        FUSE_OPT_KEY("nodiratime",              KEY_KERN_FLAG),
        FUSE_OPT_KEY("nostrictatime",           KEY_KERN_FLAG),
+       FUSE_OPT_KEY("symfollow",               KEY_KERN_FLAG),
+       FUSE_OPT_KEY("nosymfollow",             KEY_KERN_FLAG),
        FUSE_OPT_END
 };
 
@@ -185,6 +188,8 @@ static const struct mount_flags mount_flags[] = {
        {"nodiratime",      MS_NODIRATIME,      1},
        {"norelatime",      MS_RELATIME,        0},
        {"nostrictatime",   MS_STRICTATIME,     0},
+       {"symfollow",       MS_NOSYMFOLLOW,     0},
+       {"nosymfollow",     MS_NOSYMFOLLOW,     1},
 #ifndef __NetBSD__
        {"dirsync", MS_DIRSYNC,     1},
 #endif
index 5647af41a6fe3748ca26ac8c847d49d12d4331e4..e40c45799ab218362399082283501442956b2622 100644 (file)
@@ -708,6 +708,8 @@ static struct mount_flags mount_flags[] = {
        {"strictatime",     MS_STRICTATIME, 1, 1},
        {"nostrictatime",   MS_STRICTATIME, 0, 1},
        {"dirsync", MS_DIRSYNC,     1, 1},
+       {"symfollow",       MS_NOSYMFOLLOW, 0, 1},
+       {"nosymfollow",     MS_NOSYMFOLLOW, 1, 1},
        {NULL,      0,              0, 0}
 };