From e3aed302321145d529c56b0e1bfa93e1bfa4ce80 Mon Sep 17 00:00:00 2001 From: wosch Date: Wed, 8 Apr 1998 18:31:59 +0000 Subject: New mount option nosymfollow. If enabled, the kernel lookup() function will not follow symbolic links on the mounted file system and return EACCES (Permission denied). --- sbin/mount/mntopts.h | 4 +++- sbin/mount/mount.8 | 5 ++++- sbin/mount/mount.c | 5 ++++- 3 files changed, 11 insertions(+), 3 deletions(-) (limited to 'sbin/mount') diff --git a/sbin/mount/mntopts.h b/sbin/mount/mntopts.h index d9402cf..e78518a 100644 --- a/sbin/mount/mntopts.h +++ b/sbin/mount/mntopts.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)mntopts.h 8.7 (Berkeley) 3/29/95 - * $Id: mntopts.h,v 1.11 1997/09/27 13:44:08 kato Exp $ + * $Id: mntopts.h,v 1.12 1997/11/13 00:28:48 julian Exp $ */ struct mntopt { @@ -47,6 +47,7 @@ struct mntopt { #define MOPT_NODEV { "dev", 1, MNT_NODEV, 0 } #define MOPT_NOEXEC { "exec", 1, MNT_NOEXEC, 0 } #define MOPT_NOSUID { "suid", 1, MNT_NOSUID, 0 } +#define MOPT_NOSYMFOLLOW { "symfollow", 1, MNT_NOSYMFOLLOW, 0 } #define MOPT_RDONLY { "rdonly", 0, MNT_RDONLY, 0 } #define MOPT_SYNC { "sync", 0, MNT_SYNCHRONOUS, 0 } #define MOPT_UNION { "union", 0, MNT_UNION, 0 } @@ -80,6 +81,7 @@ struct mntopt { MOPT_NOEXEC, \ MOPT_SUIDDIR, /* must be before MOPT_NOSUID */ \ MOPT_NOSUID, \ + MOPT_NOSYMFOLLOW, \ MOPT_RDONLY, \ MOPT_UNION, \ MOPT_NOCLUSTERR, \ diff --git a/sbin/mount/mount.8 b/sbin/mount/mount.8 index c62e214..7c9c36e 100644 --- a/sbin/mount/mount.8 +++ b/sbin/mount/mount.8 @@ -30,7 +30,7 @@ .\" SUCH DAMAGE. .\" .\" @(#)mount.8 8.8 (Berkeley) 6/16/94 -.\" $Id: mount.8,v 1.20 1997/11/13 00:28:49 julian Exp $ +.\" $Id: mount.8,v 1.21 1997/12/01 00:44:16 steve Exp $ .\" .Dd June 16, 1994 .Dt MOUNT 8 @@ -146,6 +146,9 @@ Note: this option is worthless if a public available suid or sgid wrapper like .Xr suidperl 1 is installed on your system. +.It nosymfollow +Do not follow symlinks +on the mounted file system. .It rdonly The same as .Fl r ; diff --git a/sbin/mount/mount.c b/sbin/mount/mount.c index be4b75a..00fc842 100644 --- a/sbin/mount/mount.c +++ b/sbin/mount/mount.c @@ -42,7 +42,7 @@ static const char copyright[] = static char sccsid[] = "@(#)mount.c 8.25 (Berkeley) 5/8/95"; #else static const char rcsid[] = - "$Id: mount.c,v 1.23 1998/03/08 09:56:02 julian Exp $"; + "$Id: mount.c,v 1.24 1998/03/27 10:52:13 peter Exp $"; #endif #endif /* not lint */ @@ -91,6 +91,7 @@ static struct opt { { MNT_NODEV, "nodev" }, { MNT_NOEXEC, "noexec" }, { MNT_NOSUID, "nosuid" }, + { MNT_NOSYMFOLLOW, "nosymfollow" }, { MNT_QUOTA, "with quotas" }, { MNT_RDONLY, "read-only" }, { MNT_SYNCHRONOUS, "synchronous" }, @@ -607,6 +608,8 @@ putfsent(ent) printf(",noclusterr"); if (ent->f_flags & MNT_NOCLUSTERW) printf(",noclusterw"); + if (ent->f_flags & MNT_NOSYMFOLLOW) + printf (",nosymfollow"); if (ent->f_flags & MNT_SUIDDIR) printf(",suiddir"); -- cgit v1.1