diff options
author | julian <julian@FreeBSD.org> | 1995-11-29 12:38:49 +0000 |
---|---|---|
committer | julian <julian@FreeBSD.org> | 1995-11-29 12:38:49 +0000 |
commit | 1758bf79ff52b23e5828e97e6ed62be161d761bf (patch) | |
tree | df6dd6d66e59ff032233912a9ab538539945f4f6 /sys/miscfs/specfs | |
parent | e9b6a008cf513b0c36b6787afae1bf903ef945fb (diff) | |
download | FreeBSD-src-1758bf79ff52b23e5828e97e6ed62be161d761bf.zip FreeBSD-src-1758bf79ff52b23e5828e97e6ed62be161d761bf.tar.gz |
#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..
Diffstat (limited to 'sys/miscfs/specfs')
-rw-r--r-- | sys/miscfs/specfs/spec_vnops.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/miscfs/specfs/spec_vnops.c b/sys/miscfs/specfs/spec_vnops.c index db91648..43ca2b6 100644 --- a/sys/miscfs/specfs/spec_vnops.c +++ b/sys/miscfs/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 <sys/param.h> @@ -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. |