diff options
author | wosch <wosch@FreeBSD.org> | 1998-04-08 18:31:59 +0000 |
---|---|---|
committer | wosch <wosch@FreeBSD.org> | 1998-04-08 18:31:59 +0000 |
commit | e3aed302321145d529c56b0e1bfa93e1bfa4ce80 (patch) | |
tree | e40cc095a20b846e3f09e3cfde10b30c094504ef /sys/kern/vfs_lookup.c | |
parent | 4c738b0efc841088a79d0a7bd37d6617f0b37f4b (diff) | |
download | FreeBSD-src-e3aed302321145d529c56b0e1bfa93e1bfa4ce80.zip FreeBSD-src-e3aed302321145d529c56b0e1bfa93e1bfa4ce80.tar.gz |
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).
Diffstat (limited to 'sys/kern/vfs_lookup.c')
-rw-r--r-- | sys/kern/vfs_lookup.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index 3d258cc..709d863 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)vfs_lookup.c 8.4 (Berkeley) 2/16/94 - * $Id: vfs_lookup.c,v 1.25 1998/02/06 12:13:30 eivind Exp $ + * $Id: vfs_lookup.c,v 1.26 1998/02/15 04:17:07 dyson Exp $ */ #include "opt_ktrace.h" @@ -502,6 +502,10 @@ unionlookup: ((cnp->cn_flags & FOLLOW) || trailing_slash || *ndp->ni_next == '/')) { cnp->cn_flags |= ISSYMLINK; + if (dp->v_mount->mnt_flag & MNT_NOSYMFOLLOW) { + error = EACCES; + goto bad2; + } return (0); } |