From 246300f212f9b432b4d16856afc6bf2d7e0316ea Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp Date: Sat, 7 Jun 2003 09:09:39 +0000 Subject: [PATCH] Sanitize setting of labeloffset and labelsector. --- sbin/bsdlabel/bsdlabel.c | 15 ++++----------- sbin/bsdlabel/runtest.sh | 2 +- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/sbin/bsdlabel/bsdlabel.c b/sbin/bsdlabel/bsdlabel.c index 34ccc8807439..2ac39eb60987 100644 --- a/sbin/bsdlabel/bsdlabel.c +++ b/sbin/bsdlabel/bsdlabel.c @@ -161,12 +161,10 @@ main(int argc, char *argv[]) xxboot = optarg; break; case 'm': - if (!strcmp(optarg, "i386")) { - labelsoffset = 1; - labeloffset = 0; - bbsize = 8192; - alphacksum = 0; - } else if (!strcmp(optarg, "pc98")) { + if (!strcmp(optarg, "i386") || + !strcmp(optarg, "amd64") || + !strcmp(optarg, "ia64") || + !strcmp(optarg, "pc98")) { labelsoffset = 1; labeloffset = 0; bbsize = 8192; @@ -176,11 +174,6 @@ main(int argc, char *argv[]) labeloffset = 64; bbsize = 8192; alphacksum = 1; - } else if (!strcmp(optarg, "ia64")) { - labelsoffset = 1; - labeloffset = 0; - bbsize = 8192; - alphacksum = 0; } else { errx(1, "Unsupported architecture"); } diff --git a/sbin/bsdlabel/runtest.sh b/sbin/bsdlabel/runtest.sh index eb43b90b237a..9d561f39ab82 100644 --- a/sbin/bsdlabel/runtest.sh +++ b/sbin/bsdlabel/runtest.sh @@ -3,7 +3,7 @@ TMP=/tmp/$$. set -e -for TEST in "i386 512" "i386 4096" "alpha 512" "pc98 512" "pc98 4096" +for TEST in "i386 512" "i386 4096" "alpha 512" do set $TEST ARCH=$1