aboutsummaryrefslogtreecommitdiff
path: root/sbin/mount
diff options
context:
space:
mode:
authorWolfram Schneider <wosch@FreeBSD.org>1998-04-08 18:31:59 +0000
committerWolfram Schneider <wosch@FreeBSD.org>1998-04-08 18:31:59 +0000
commit5ddc8ded1dbe650b7d83240a1f86a1eb6e2b9b5a (patch)
tree8c2d1bd63f6fe85fd09d4107b33e303dcaaaa6e7 /sbin/mount
parent9d24fe0e45513af5b8eb8351fc40766c6f7bbf31 (diff)
downloadsrc-5ddc8ded1dbe650b7d83240a1f86a1eb6e2b9b5a.tar.gz
src-5ddc8ded1dbe650b7d83240a1f86a1eb6e2b9b5a.zip
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).
Notes
Notes: svn path=/head/; revision=35105
Diffstat (limited to 'sbin/mount')
-rw-r--r--sbin/mount/mntopts.h4
-rw-r--r--sbin/mount/mount.85
-rw-r--r--sbin/mount/mount.c5
3 files changed, 11 insertions, 3 deletions
diff --git a/sbin/mount/mntopts.h b/sbin/mount/mntopts.h
index d9402cf4e0ed..e78518a377bb 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 c62e21410034..7c9c36e47655 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 be4b75a8e8b0..00fc84263dde 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");