diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2007-06-18 21:06:52 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2007-06-18 21:06:52 +0000 |
commit | d5e58aae0cd7e4acfa62187324beaa344d28f3ad (patch) | |
tree | 51aa3448161fa9ccb052f5bc973e061633a6eebd /sbin | |
parent | 83650bf4e48a1bc81f78a500e54ed7c673403455 (diff) |
-r will die. Until then, make sure any labels it dredges up are
converted to v1 format before being used.
ok deraadt@ otto@
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/disklabel/disklabel.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sbin/disklabel/disklabel.c b/sbin/disklabel/disklabel.c index b64099e807f..deb61d1d7d9 100644 --- a/sbin/disklabel/disklabel.c +++ b/sbin/disklabel/disklabel.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disklabel.c,v 1.114 2007/06/17 00:32:21 deraadt Exp $ */ +/* $OpenBSD: disklabel.c,v 1.115 2007/06/18 21:06:51 krw Exp $ */ /* * Copyright (c) 1987, 1993 @@ -39,7 +39,7 @@ static const char copyright[] = #endif /* not lint */ #ifndef lint -static const char rcsid[] = "$OpenBSD: disklabel.c,v 1.114 2007/06/17 00:32:21 deraadt Exp $"; +static const char rcsid[] = "$OpenBSD: disklabel.c,v 1.115 2007/06/18 21:06:51 krw Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -702,8 +702,10 @@ readlabel(int f) if (lp->d_magic == DISKMAGIC && lp->d_magic2 == DISKMAGIC) { if (lp->d_npartitions <= MAXPARTITIONS && - dkcksum(lp) == 0) + dkcksum(lp) == 0) { + cvtdisklabelv1(lp); return (lp); + } msg = "disk label corrupted"; } @@ -722,6 +724,7 @@ readlabel(int f) dkcksum(lp) == 0) { warnx("found at 0x%lx", (long)((char *)lp - bootarea)); + cvtdisklabelv1(lp); return (lp); } msg = "disk label corrupted"; |