* util/getroot.c (grub_util_biosdisk_get_grub_dev): Zero out
authorColin Watson <cjwatson@ubuntu.com>
Tue, 13 Aug 2013 15:48:56 +0000 (17:48 +0200)
committerColin Watson <cjwatson@ubuntu.com>
Tue, 13 Aug 2013 15:48:56 +0000 (17:48 +0200)
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
util/getroot.c

index 628d7e9..64fb3dd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2013-08-13  Colin Watson  <cjwatson@ubuntu.com>
+
+       * 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  <gregoire.sutre@gmail.com>
 
        * autogen.sh: Replace find -not by the POSIX-compliant find !.
index 2ad8a55..ab5ff8d 100644 (file)
@@ -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);