dcavalca / rpms / grub2

Forked from rpms/grub2 3 years ago
Clone
8631a2
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
8631a2
From: Peter Jones <pjones@redhat.com>
8631a2
Date: Fri, 28 Sep 2018 15:42:19 -0400
8631a2
Subject: [PATCH] Fix getroot.c's trampolines.
8631a2
8631a2
This makes the stack executable on most of the grub utilities, which is
8631a2
bad, and rpmdiff complains about it.
8631a2
8631a2
Related: rhbz#1633646
8631a2
8631a2
Signed-off-by: Peter Jones <pjones@redhat.com>
8631a2
---
8631a2
 grub-core/osdep/linux/getroot.c | 16 +++++++---------
8631a2
 1 file changed, 7 insertions(+), 9 deletions(-)
8631a2
8631a2
diff --git a/grub-core/osdep/linux/getroot.c b/grub-core/osdep/linux/getroot.c
8631a2
index 4c5a13022dc..388a0f70638 100644
8631a2
--- a/grub-core/osdep/linux/getroot.c
8631a2
+++ b/grub-core/osdep/linux/getroot.c
8631a2
@@ -1264,22 +1264,20 @@ grub_util_get_grub_dev_os (const char *os_dev)
8631a2
   return grub_dev;
8631a2
 }
8631a2
 
8631a2
+static void *mp = NULL;
8631a2
+static void
8631a2
+btrfs_mount_path_hook(const char *m)
8631a2
+{
8631a2
+  mp = strdup (m);
8631a2
+}
8631a2
 
8631a2
 char *
8631a2
 grub_util_get_btrfs_subvol (const char *path, char **mount_path)
8631a2
 {
8631a2
-  char *mp = NULL;
8631a2
-
8631a2
   if (mount_path)
8631a2
     *mount_path = NULL;
8631a2
 
8631a2
-  auto void
8631a2
-  mount_path_hook (const char *m)
8631a2
-  {
8631a2
-    mp = strdup (m);
8631a2
-  }
8631a2
-
8631a2
-  grub_find_root_btrfs_mount_path_hook = mount_path_hook;
8631a2
+  grub_find_root_btrfs_mount_path_hook = btrfs_mount_path_hook;
8631a2
   grub_free (grub_find_root_devices_from_mountinfo (path, NULL));
8631a2
   grub_find_root_btrfs_mount_path_hook = NULL;
8631a2