summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2021-09-29 22:55:41 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2021-09-29 22:55:41 +0000
commit96923af178aae961a8acca3c39a6cbb2c1ceb281 (patch)
treea5084d8dcfd12cb3bf6d0bc6027355fc91d0a62e /sbin
parentf94d137f226049589995eeeba26ba31c2c888ee4 (diff)
Don't constrain -b specified block count or block size to be greater than 63.
Allow any value from 1 to UINT32_MAX. MBR boot partition sizes/offsets are completely machine dependent. Pointed out by loongson.
Diffstat (limited to 'sbin')
-rw-r--r--sbin/fdisk/fdisk.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/sbin/fdisk/fdisk.c b/sbin/fdisk/fdisk.c
index 826b034c93d..39e7bbf6ee9 100644
--- a/sbin/fdisk/fdisk.c
+++ b/sbin/fdisk/fdisk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fdisk.c,v 1.137 2021/09/26 13:13:16 krw Exp $ */
+/* $OpenBSD: fdisk.c,v 1.138 2021/09/29 22:55:40 krw Exp $ */
/*
* Copyright (c) 1997 Tobias Weingartner
@@ -227,19 +227,18 @@ parse_bootprt(const char *arg)
*ptype++ = '\0';
}
- blockcount = strtonum(arg, BLOCKALIGNMENT, UINT32_MAX, &errstr);
+ blockcount = strtonum(arg, 1, UINT32_MAX, &errstr);
if (errstr)
- errx(1, "Block argument %s [%u..%u].", errstr, BLOCKALIGNMENT,
- UINT32_MAX);
+ errx(1, "Block argument %s [%u..%u].", errstr, 1, UINT32_MAX);
if (poffset == NULL)
goto done;
/* Second number: # of 512-byte blocks to offset partition start. */
- blockoffset = strtonum(poffset, BLOCKALIGNMENT, UINT32_MAX, &errstr);
+ blockoffset = strtonum(poffset, 1, UINT32_MAX, &errstr);
if (errstr)
- errx(1, "Block offset argument %s [%u..%u].", errstr,
- BLOCKALIGNMENT, UINT32_MAX);
+ errx(1, "Block offset argument %s [%u..%u].", errstr, 1,
+ UINT32_MAX);
if (ptype == NULL)
goto done;