From 1758bf79ff52b23e5828e97e6ed62be161d761bf Mon Sep 17 00:00:00 2001 From: julian Date: Wed, 29 Nov 1995 12:38:49 +0000 Subject: #ifdef out nearly the entire file of conf.c when JREMOD is defined add a few safety checks in specfs because now it's possible to get entries in [cd]devsw[] which are ALL NULL so it's better to discover this BEFORE jumping into the d_open() entry.. more check to come later.. this getsthe code to the stage where I can start testing it, even if I haven't caught every little error case... I guess I'll find them quick enough.. --- sys/fs/specfs/spec_vnops.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'sys/fs') diff --git a/sys/fs/specfs/spec_vnops.c b/sys/fs/specfs/spec_vnops.c index db91648..43ca2b6 100644 --- a/sys/fs/specfs/spec_vnops.c +++ b/sys/fs/specfs/spec_vnops.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)spec_vnops.c 8.6 (Berkeley) 4/9/94 - * $Id: spec_vnops.c,v 1.17 1995/11/09 08:16:15 bde Exp $ + * $Id: spec_vnops.c,v 1.18 1995/11/18 12:49:14 bde Exp $ */ #include @@ -154,6 +154,10 @@ spec_open(ap) case VCHR: if ((u_int)maj >= nchrdev) return (ENXIO); +#ifdef JREMOD + if ( cdevsw[maj].d_open == NULL) + return ENXIO; +#endif /*JREMOD*/ if (ap->a_cred != FSCRED && (ap->a_mode & FWRITE)) { /* * When running in very secure mode, do not allow @@ -185,6 +189,10 @@ spec_open(ap) case VBLK: if ((u_int)maj >= nblkdev) return (ENXIO); +#ifdef JREMOD + if ( bdevsw[maj].d_open == NULL) + return ENXIO; +#endif /*JREMOD*/ /* * When running in very secure mode, do not allow * opens for writing of any disk block devices. -- cgit v1.1