From owner-freebsd-fs Tue Oct 28 07:34:21 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id HAA29308 for fs-outgoing; Tue, 28 Oct 1997 07:34:21 -0800 (PST) (envelope-from owner-freebsd-fs) Received: from mailer.zib.de (mailer.zib.de [130.73.108.11]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id HAA29189 for ; Tue, 28 Oct 1997 07:33:49 -0800 (PST) (envelope-from wolfram@softs11.zib.de) Received: from soft13.zib.de (soft13.zib.de [130.73.63.13] (may be forged)) by mailer.zib.de (8.8.7/8.8.7) with SMTP id QAA18146; Tue, 28 Oct 1997 16:33:20 +0100 (MET) Received: by soft13.zib.de (SMI-8.6/SMI-SVR4) id QAA04035; Tue, 28 Oct 1997 16:33:19 +0100 Date: Tue, 28 Oct 1997 16:33:19 +0100 Message-Id: <199710281533.QAA04035@soft13.zib.de> From: Wolfram Schneider To: Ollivier Robert Cc: freebsd-fs@FreeBSD.ORG Subject: Re: disabled symlinks In-Reply-To: <19971027001140.31561@keltia.freenix.fr> References: <199710261041.LAA00556@panke.panke.de> <19971027001140.31561@keltia.freenix.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Sender: owner-freebsd-fs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk Ollivier Robert writes: >According to Wolfram Schneider: >> The nosymlink flag do not allow the creation of a symlink >> on the mounted file system. >Could you please modify your patch not to _follow_ symlinks in order to >disallow all symlinks in a given FS ? The patch return 'Permission denied' for symlinks in the kernel function namei/lookup. Index: vfs_lookup.c =================================================================== RCS file: /usr/cvs/src/sys/kern/vfs_lookup.c,v retrieving revision 1.11.4.1 diff -u -r1.11.4.1 vfs_lookup.c --- vfs_lookup.c 1996/12/03 15:48:25 1.11.4.1 +++ vfs_lookup.c 1997/10/27 14:51:56 @@ -493,6 +493,10 @@ ((cnp->cn_flags & FOLLOW) || trailing_slash || *ndp->ni_next == '/')) { cnp->cn_flags |= ISSYMLINK; + if (dp->v_mount->mnt_flag & MNT_NOSYMLINK) { + error = EACCES; + goto bad2; + } return (0); }