grub2/0451-types-Make-bool-generally-available.patch
Nicolas Frayer 6eaa34fe07 Add several CVE fixes
- Resolves: CVE-2024-45779 CVE-2024-45778 CVE-2025-1118
- Resolves: CVE-2025-0677 CVE-2024-45782 CVE-2025-0690
- Resolves: CVE-2024-45783 CVE-2025-0624 CVE-2024-45776
- Resolves: CVE-2025-0622 CVE-2024-45774 CVE-2024-45775
- Resolves: CVE-2024-45781 CVE-2024-45780
- Resolves: #RHEL-79700
- Resolves: #RHEL-79341
- Resolves: #RHEL-79875
- Resolves: #RHEL-79849
- Resolves: #RHEL-79707
- Resolves: #RHEL-79857
- Resolves: #RHEL-79709
- Resolves: #RHEL-79846
- Resolves: #RHEL-75737
- Resolves: #RHEL-79713
- Resolves: #RHEL-73785
- Resolves: #RHEL-73787
- Resolves: #RHEL-79704
- Resolves: #RHEL-79702

Signed-off-by: Nicolas Frayer <nfrayer@redhat.com>
2025-02-18 19:06:15 +01:00

79 lines
2.4 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Robbie Harwood <rharwood@redhat.com>
Date: Fri, 4 Nov 2022 12:13:34 -0400
Subject: [PATCH] types: Make bool generally available
Add an include on stdbool.h, making the bool type generally available
within the GRUB without needing to add a file-specific include every
time it would be used.
Signed-off-by: Robbie Harwood <rharwood@redhat.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
---
grub-core/commands/parttool.c | 2 +-
grub-core/parttool/msdospart.c | 4 ++--
include/grub/parttool.h | 2 +-
include/grub/types.h | 1 +
4 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/grub-core/commands/parttool.c b/grub-core/commands/parttool.c
index 051e31320..ff45c65e6 100644
--- a/grub-core/commands/parttool.c
+++ b/grub-core/commands/parttool.c
@@ -315,7 +315,7 @@ grub_cmd_parttool (grub_command_t cmd __attribute__ ((unused)),
switch (curarg->type)
{
case GRUB_PARTTOOL_ARG_BOOL:
- pargs[curarg - ptool->args].bool
+ pargs[curarg - ptool->args].b
= (args[j][grub_strlen (curarg->name)] != '-');
break;
diff --git a/grub-core/parttool/msdospart.c b/grub-core/parttool/msdospart.c
index 3918caa06..3a7699e45 100644
--- a/grub-core/parttool/msdospart.c
+++ b/grub-core/parttool/msdospart.c
@@ -61,7 +61,7 @@ static grub_err_t grub_pcpart_boot (const grub_device_t dev,
return grub_errno;
}
- if (args[0].set && args[0].bool)
+ if (args[0].set && args[0].b)
{
for (i = 0; i < 4; i++)
mbr.entries[i].flag = 0x0;
@@ -116,7 +116,7 @@ static grub_err_t grub_pcpart_type (const grub_device_t dev,
if (args[1].set)
{
- if (args[1].bool)
+ if (args[1].b)
type |= GRUB_PC_PARTITION_TYPE_HIDDEN_FLAG;
else
type &= ~GRUB_PC_PARTITION_TYPE_HIDDEN_FLAG;
diff --git a/include/grub/parttool.h b/include/grub/parttool.h
index 4e8f8d5e5..4799a22c5 100644
--- a/include/grub/parttool.h
+++ b/include/grub/parttool.h
@@ -32,7 +32,7 @@ struct grub_parttool_args
int set;
union
{
- int bool;
+ int b;
char *str;
};
};
diff --git a/include/grub/types.h b/include/grub/types.h
index ba446d990..c00842ab0 100644
--- a/include/grub/types.h
+++ b/include/grub/types.h
@@ -20,6 +20,7 @@
#define GRUB_TYPES_HEADER 1
#include <config.h>
+#include <stdbool.h>
#ifndef GRUB_UTIL
#include <grub/cpu/types.h>
#endif