From 274beb915538a2609709812701de36baaac5100e Mon Sep 17 00:00:00 2001 From: "Brian C. Lane" Date: Tue, 7 Jan 2025 16:50:21 -0800 Subject: [PATCH 10/13] libparted: Fix sun disklabel unhandled exception The CHS warning should only continue if ignored, not if unhandled. Script mode, or exception handlers can return PED_EXCEPTION_UNHANDLED which should act the same as a cancel. Previously it would only exit if cancel was selected, allowing it to continue to use the bad CHS and crash later. (cherry picked from commit 95b877cfa36c1571487c2a67a3902f1f5c4dc747) Resolves: RHEL-73217 --- libparted/labels/sun.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libparted/labels/sun.c b/libparted/labels/sun.c index 622c984..6e52dde 100644 --- a/libparted/labels/sun.c +++ b/libparted/labels/sun.c @@ -284,7 +284,7 @@ _check_geometry_sanity (PedDisk* disk, SunRawLabel* label) PED_BE16_TO_CPU(label->pcylcount), PED_BE16_TO_CPU(label->ntrks), PED_BE16_TO_CPU(label->nsect)) - == PED_EXCEPTION_CANCEL) + != PED_EXCEPTION_IGNORE) return 0; #endif dev->bios_geom.sectors = PED_BE16_TO_CPU(label->nsect); -- 2.48.1