Possible bug in grub2
Hi,
I'm currently in the process of backporting some changes recently gone into grub2 to an older version for a local package. During that I think I've found a bug. Changeset 3185 contains among other things the following:
grub-setup.c 2011-04-08 11:59:07 +0000 renamed from grub-setup.c 2011-03-29 00:20:52 +0000 +9 -1
@@ -973,7 +973,15 @@ char **devicelist; int i; - devicelist = grub_util_raid_getmembers (dest_dev); + if (arguments.device[0] == '/') + devicelist = grub_util_raid_getmembers (arguments.device); + else + { + char *devname; + devname = xasprintf ("/dev/%s", dest_dev); + devicelist = grub_util_raid_getmembers (dest_dev); + free (devname); + } for (i = 0; devicelist[i]; i++) {
Judging from the changes made to the grub_util_raid_getmembers function in the same changeset it now expects a full path to a device instead of a postfix which it previously prepended with "/dev/". As such it should be called with "devname" instead of "dest_dev" in the else branch above.
Untested patch against current trunk is attached.
Regards
Florian Wagner
--------------
Florian Wagner
Abteilung EDV
Telefon: 0821 / 4201 - 453
Fax: 0821 / 4201 - 411
E-Mail: [email protected]
Syscomp Biochemische Dienstleistungen GmbH
August-Wessels-Straße 5, 86154 Augsburg
Postfach 102506, 86015 Augsburg
Telefon: 0821 / 4201 - 0
Fax: 0821 / 417992
Web: http://www.syscomp.de
E-Mail: [email protected]
Geschäftsführerin:
Gabriele Schottdorf
Registergericht Augsburg HRB 8670
=== modified file 'util/grub-setup.c'
grub-setup.c +1 -1
@@ -977,7 +977,7 @@ {char *devname; devname =xasprintf ("/dev/%s" , dest_dev); - devicelist =grub_util_raid_getmembers (dest_dev); + devicelist =grub_util_raid_getmembers (devname);free (devname); }