diff options
author | chuck <chuck@cvs.openbsd.org> | 1996-11-08 20:49:13 +0000 |
---|---|---|
committer | chuck <chuck@cvs.openbsd.org> | 1996-11-08 20:49:13 +0000 |
commit | 68a693a7b3d71ec52ac9a2459bced1e95c313e50 (patch) | |
tree | f78a1abaf1d8de7d9e1d25382a230c6e90dcd930 | |
parent | c9f9c19bf0f0a59693f66e243f5072c0e2abd2b3 (diff) |
apply netbsd pr#2598 from der mouse:
everything before the beginning of the "a" partition on a disk
is read-only except when accessed via RAW_PART. (a problem if
"a" isn't at the front of the disk).
-rw-r--r-- | sys/arch/mvme68k/mvme68k/disksubr.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/sys/arch/mvme68k/mvme68k/disksubr.c b/sys/arch/mvme68k/mvme68k/disksubr.c index 66a0e2e7938..1e636cb34ff 100644 --- a/sys/arch/mvme68k/mvme68k/disksubr.c +++ b/sys/arch/mvme68k/mvme68k/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.7 1996/05/29 16:37:17 chuck Exp $ */ +/* $OpenBSD: disksubr.c,v 1.8 1996/11/08 20:49:12 chuck Exp $ */ /* * Copyright (c) 1995 Dale Rahn. @@ -301,16 +301,14 @@ bounds_check_with_label(bp, lp, wlabel) int wlabel; { struct partition *p = lp->d_partitions + DISKPART(bp->b_dev); - int labelsect = lp->d_partitions[0].p_offset; int maxsz = p->p_size; int sz = (bp->b_bcount + DEV_BSIZE - 1) >> DEV_BSHIFT; /* overwriting disk label ? */ /* XXX should also protect bootstrap in first 8K */ - if (bp->b_blkno + p->p_offset <= LABELSECTOR + labelsect && -#if LABELSECTOR != 0 - bp->b_blkno + p->p_offset + sz > LABELSECTOR + labelsect && -#endif + /* XXX this assumes everything <=LABELSECTOR is label! */ + /* (but since LABELSECTOR is zero, this is ok) */ + if (bp->b_blkno + p->p_offset <= LABELSECTOR && (bp->b_flags & B_READ) == 0 && wlabel == 0) { bp->b_error = EROFS; goto bad; |