summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2022-04-23 14:39:17 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2022-04-23 14:39:17 +0000
commitb4317876c0fde18718b20793bf769a766d0b7c52 (patch)
treeffc66bf3788ad458fad0b34f322ccca5b664f1cb
parent31c114f16c4d515529b1ba9a039f257a7c7ac139 (diff)
Add missing uuid_dec_le() to init_gp() so -A works on
big-endian architectures too.
-rw-r--r--sbin/fdisk/gpt.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sbin/fdisk/gpt.c b/sbin/fdisk/gpt.c
index 315e45bb819..9e2b8fe93fd 100644
--- a/sbin/fdisk/gpt.c
+++ b/sbin/fdisk/gpt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gpt.c,v 1.72 2022/04/20 23:36:30 krw Exp $ */
+/* $OpenBSD: gpt.c,v 1.73 2022/04/23 14:39:16 krw Exp $ */
/*
* Copyright (c) 2015 Markus Muller <mmu@grummel.net>
* Copyright (c) 2015 Kenneth R Westerback <krw@openbsd.org>
@@ -578,6 +578,7 @@ int
init_gp(const int how)
{
struct gpt_partition oldgp[NGPTPARTITIONS];
+ struct uuid gp_type;
const uint8_t gpt_uuid_efi_system[] = GPT_UUID_EFI_SYSTEM;
const uint8_t gpt_uuid_openbsd[] = GPT_UUID_OPENBSD;
uint64_t prt_ns;
@@ -588,7 +589,8 @@ init_gp(const int how)
memset(&gp, 0, sizeof(gp));
else {
for (pn = 0; pn < gh.gh_part_num; pn++) {
- if (PRT_protected_guid(&gp[pn].gp_type))
+ uuid_dec_le(&gp[pn].gp_type, &gp_type);
+ if (PRT_protected_guid(&gp_type))
continue;
memset(&gp[pn], 0, sizeof(gp[pn]));
}