diff options
author | 2007-06-18 21:06:51 +0000 | |
---|---|---|
committer | 2007-06-18 21:06:51 +0000 | |
commit | c695b6ff7aef6cb1c2a13aff43d6e63b8bac5610 (patch) | |
tree | 3dc9fec1c80af72977a44758afc5ead5417332f9 | |
parent | avoid modification race in DIOCRLDINFO; ok krw miod (diff) | |
download | wireguard-openbsd-c695b6ff7aef6cb1c2a13aff43d6e63b8bac5610.tar.xz wireguard-openbsd-c695b6ff7aef6cb1c2a13aff43d6e63b8bac5610.zip |
-r will die. Until then, make sure any labels it dredges up are
converted to v1 format before being used.
ok deraadt@ otto@
-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"; |