From 36e87d25e14d12f0e511a3662d690d144a7c54fe Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Tue, 13 Aug 2013 17:48:56 +0200 Subject: [PATCH] * util/getroot.c (grub_util_biosdisk_get_grub_dev): Zero out grub_errno in the case where we handle GRUB_ERR_UNKNOWN_DEVICE by falling back to the partition device, otherwise a later call to this function may fail spuriously. Reported by Axel Beckert. Fixes Debian bug #708614. --- ChangeLog | 8 ++++++++ util/getroot.c | 1 + 2 files changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index 628d7e92c..64fb3dd3b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2013-08-13 Colin Watson + + * util/getroot.c (grub_util_biosdisk_get_grub_dev): Zero out + grub_errno in the case where we handle GRUB_ERR_UNKNOWN_DEVICE by + falling back to the partition device, otherwise a later call to this + function may fail spuriously. + Reported by Axel Beckert. Fixes Debian bug #708614. + 2013-08-12 Grégoire Sutre * autogen.sh: Replace find -not by the POSIX-compliant find !. diff --git a/util/getroot.c b/util/getroot.c index 2ad8a55ce..ab5ff8dea 100644 --- a/util/getroot.c +++ b/util/getroot.c @@ -2408,6 +2408,7 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev) grub_util_warn (_("disk does not exist, so falling back to partition device %s"), os_dev); + grub_errno = GRUB_ERR_NONE; canon = canonicalize_file_name (os_dev); drive = find_system_device (canon ? : os_dev, &st, 0, 1);