summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2014-01-24 10:25:57 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2014-01-24 10:25:57 +0000
commit59d7b5629c14f0423f04b0a691254d7918f40fd7 (patch)
treec3eb59a24133ac7597cab5bed4d37d551e85683f
parent5369a085003f7523d3a467d13840afa2ba6ac47f (diff)
When a disklabel is read from a MBR partitioned disk, don't
replace the OpenBSD bounds with the A6 MBR partition limits. Thus preserving any changes the user makes with the 'b' command in disklabel. Reported, tested & ok blambert@, ok deraadt@
-rw-r--r--sys/kern/subr_disk.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/kern/subr_disk.c b/sys/kern/subr_disk.c
index b4c5cb860b1..6d1ba19d1a8 100644
--- a/sys/kern/subr_disk.c
+++ b/sys/kern/subr_disk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_disk.c,v 1.162 2014/01/23 00:32:57 krw Exp $ */
+/* $OpenBSD: subr_disk.c,v 1.163 2014/01/24 10:25:56 krw Exp $ */
/* $NetBSD: subr_disk.c,v 1.17 1996/03/16 23:17:08 christos Exp $ */
/*
@@ -523,7 +523,10 @@ notfat:
if (biowait(bp))
return (bp->b_error);
- error = checkdisklabel(bp->b_data + offset, lp, dospartoff, dospartend);
+
+ error = checkdisklabel(bp->b_data + offset, lp,
+ DL_GETBSTART((struct disklabel*)(bp->b_data+offset)),
+ DL_GETBEND((struct disklabel *)(bp->b_data+offset)));
/* XXX Remove after 5.5. It's meant for a short sharp transition! */
if (error == ENOENT && lp->d_secsize != DEV_BSIZE) {
/*