|
From: | Christian Franke |
Subject: | Re: [PATCH] Add host open devicename check |
Date: | Sat, 10 Nov 2007 14:52:36 +0100 |
User-agent: | Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070802 SeaMonkey/1.1.4 |
Robert Millan wrote:
On Fri, Nov 09, 2007 at 10:17:19PM +0100, Marco Gerards wrote:Robert Millan <address@hidden> writes:On Thu, Oct 25, 2007 at 09:51:38PM +0200, Christian Franke wrote:static grub_err_t -grub_host_open (const char *name __attribute((unused)), grub_disk_t disk) +grub_host_open (const char *name, grub_disk_t disk) { + if (grub_strcmp(name, "host")) + return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "not a host disk"); +I would test for (disk->id == GRUB_DISK_DEVICE_HOST_ID) instead. Faster, and also cleaner/simpler IMHO.It's not possible unfortunately :-(. This information is about to be filled in in this same function.Still seems like an ugly hack to me. Oh well :-/
All disk/* modules' open routines check whether the name (hd%d, ata%d, ...) is valid and return UNKNOWN_DEVICE on error. The missing name check in host.c is a bug which can IMO only be fixed this way.
Christian
[Prev in Thread] | Current Thread | [Next in Thread] |