mnt_optstr_append_option(optstr, "suid", NULL);
if (!(cxt->mountflags & MS_NODEV))
mnt_optstr_append_option(optstr, "dev", NULL);
+ if (!(cxt->mountflags & MS_NOSYMFOLLOW))
+ mnt_optstr_append_option(optstr, "symfollow", NULL);
}
#ifndef MS_DIRSYNC
#define MS_DIRSYNC 128 /* Directory modifications are synchronous */
#endif
+#ifndef MS_NOSYMFOLLOW
+#define MS_NOSYMFOLLOW 256 /* Don't follow symlinks */
+#endif
#ifndef MS_NOATIME
#define MS_NOATIME 0x400 /* 1024: Do not update access times. */
#endif
{ "rslave", MS_SLAVE | MS_REC, MNT_NOHLPS | MNT_NOMTAB },
{ "shared", MS_SHARED, MNT_NOHLPS | MNT_NOMTAB }, /* Shared */
{ "rshared", MS_SHARED | MS_REC, MNT_NOHLPS | MNT_NOMTAB },
+#endif
+#ifdef MS_NOSYMFOLLOW
+ { "symfollow", MS_NOSYMFOLLOW, MNT_INVERT }, /* Don't follow symlinks */
+ { "nosymfollow", MS_NOSYMFOLLOW },
#endif
{ NULL, 0, 0 }
};
in octal notation. The default mode is 0755. This functionality is supported
only for root users or when mount executed without suid permissions. The option
is also supported as x-mount.mkdir, this notation is deprecated since v2.30.
+.TP
+.B nosymfollow
+Do not follow symlinks when resolving paths. Symlinks can still be created,
+and
+.BR readlink (1),
+.BR readlink (2),
+.BR realpath (1)
+and
+.BR realpath (3)
+all still work properly.
.SH FILESYSTEM-SPECIFIC MOUNT OPTIONS
This section lists options that are specific to particular filesystems.