31 lines
999 B
Diff
31 lines
999 B
Diff
From b80fb30a5b79ce2cc8c7486e1435ec061aa79e2f Mon Sep 17 00:00:00 2001
|
|
From: Karel Zak <kzak@redhat.com>
|
|
Date: Tue, 28 Apr 2020 12:58:42 +0200
|
|
Subject: [PATCH 234/389] libfdisk: make sure we check for maximal number of
|
|
partitions
|
|
|
|
Addresses: https://github.com/karelzak/util-linux/issues/1018
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
---
|
|
libfdisk/src/dos.c | 4 ++--
|
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/libfdisk/src/dos.c b/libfdisk/src/dos.c
|
|
index 5e8ad17..79a5552 100644
|
|
--- a/libfdisk/src/dos.c
|
|
+++ b/libfdisk/src/dos.c
|
|
@@ -1756,8 +1756,8 @@ static int dos_add_partition(struct fdisk_context *cxt,
|
|
if (last + grain < cxt->total_sectors - 1)
|
|
free_sectors = 1;
|
|
|
|
- if (!free_primary && cxt->label->nparts_max >= MAXIMUM_PARTS) {
|
|
- fdisk_info(cxt, _("The maximum number of partitions has "
|
|
+ if (cxt->label->nparts_max >= MAXIMUM_PARTS) {
|
|
+ fdisk_warnx(cxt, _("The maximum number of partitions has "
|
|
"been created."));
|
|
return -EINVAL;
|
|
}
|
|
--
|
|
1.8.3.1
|
|
|