From d38d126a212199f524b5703fb17cb45e5bf43fba Mon Sep 17 00:00:00 2001 From: mpp Date: Sat, 2 Sep 1995 20:19:12 +0000 Subject: [PATCH] Do not allow delete/rename lookup request to prevent panics if a user attempts to remove/rename files in a fdesc file system. --- sys/fs/fdescfs/fdesc_vnops.c | 8 +++++++- sys/miscfs/fdesc/fdesc_vnops.c | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/sys/fs/fdescfs/fdesc_vnops.c b/sys/fs/fdescfs/fdesc_vnops.c index 420320acab7e..fec7b444e6a3 100644 --- a/sys/fs/fdescfs/fdesc_vnops.c +++ b/sys/fs/fdescfs/fdesc_vnops.c @@ -35,7 +35,7 @@ * * @(#)fdesc_vnops.c 8.9 (Berkeley) 1/21/94 * - * $Id: fdesc_vnops.c,v 1.8 1995/03/28 07:56:44 bde Exp $ + * $Id: fdesc_vnops.c,v 1.9 1995/05/30 08:06:57 rgrimes Exp $ */ /* @@ -192,6 +192,12 @@ fdesc_lookup(ap) struct vnode *fvp; char *ln; + if (ap->a_cnp->cn_nameiop == DELETE || + ap->a_cnp->cn_nameiop == RENAME) { + error = EROFS; + goto bad; + } + pname = ap->a_cnp->cn_nameptr; if (ap->a_cnp->cn_namelen == 1 && *pname == '.') { *vpp = dvp; diff --git a/sys/miscfs/fdesc/fdesc_vnops.c b/sys/miscfs/fdesc/fdesc_vnops.c index 420320acab7e..fec7b444e6a3 100644 --- a/sys/miscfs/fdesc/fdesc_vnops.c +++ b/sys/miscfs/fdesc/fdesc_vnops.c @@ -35,7 +35,7 @@ * * @(#)fdesc_vnops.c 8.9 (Berkeley) 1/21/94 * - * $Id: fdesc_vnops.c,v 1.8 1995/03/28 07:56:44 bde Exp $ + * $Id: fdesc_vnops.c,v 1.9 1995/05/30 08:06:57 rgrimes Exp $ */ /* @@ -192,6 +192,12 @@ fdesc_lookup(ap) struct vnode *fvp; char *ln; + if (ap->a_cnp->cn_nameiop == DELETE || + ap->a_cnp->cn_nameiop == RENAME) { + error = EROFS; + goto bad; + } + pname = ap->a_cnp->cn_nameptr; if (ap->a_cnp->cn_namelen == 1 && *pname == '.') { *vpp = dvp;