diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2009-06-14 00:09:41 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2009-06-14 00:09:41 +0000 |
commit | 02a365840c38e842976e2e6bfb8a24990aaa23e6 (patch) | |
tree | 40b28e93438bd0c49cdee7b2a2acc9bdab782d28 /sys/arch/socppc | |
parent | 7e97643755bb45a839c99309ba46c6c5b31c0669 (diff) |
Don't mess with the bounds in the lp if *partoffp is non-NULL, since this
indicates that writedisklabel is trying to find the location for writing
the label. If the lp is messed with, an invalid checksum is written.
done with miod and kettenis, lots of moaning and gnashing of teeth, etc
Diffstat (limited to 'sys/arch/socppc')
-rw-r--r-- | sys/arch/socppc/socppc/disksubr.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/arch/socppc/socppc/disksubr.c b/sys/arch/socppc/socppc/disksubr.c index c7c459d0a64..380732c4cb8 100644 --- a/sys/arch/socppc/socppc/disksubr.c +++ b/sys/arch/socppc/socppc/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.7 2009/06/05 00:41:13 deraadt Exp $ */ +/* $OpenBSD: disksubr.c,v 1.8 2009/06/14 00:09:39 deraadt Exp $ */ /* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */ /* @@ -147,6 +147,11 @@ readdpmelabel(struct buf *bp, void (*strat)(struct buf *), if (partoffp) { *partoffp = hfspartoff; return (NULL); + } else { + DL_SETBSTART(lp, hfspartoff); + DL_SETBEND(lp, + hfspartend < DL_GETDSIZE(lp) ? hfspartend : + DL_GETDSIZE(lp)); } continue; } @@ -162,10 +167,6 @@ readdpmelabel(struct buf *bp, void (*strat)(struct buf *), pp->p_fstype = FS_HFS; n++; } - - DL_SETBSTART(lp, hfspartoff); - DL_SETBEND(lp, hfspartend < DL_GETDSIZE(lp) ? hfspartend : - DL_GETDSIZE(lp)); } if (hfspartoff == -1) |