From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Iqqlc-0006YG-0r for mharc-grub-devel@gnu.org; Sat, 10 Nov 2007 08:52:56 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Iqqla-0006Vb-3S for grub-devel@gnu.org; Sat, 10 Nov 2007 08:52:54 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IqqlY-0006Sd-Po for grub-devel@gnu.org; Sat, 10 Nov 2007 08:52:53 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IqqlY-0006ST-HK for grub-devel@gnu.org; Sat, 10 Nov 2007 08:52:52 -0500 Received: from mailout04.sul.t-online.de ([194.25.134.18] helo=mailout04.sul.t-online.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IqqlY-0004TB-CK for grub-devel@gnu.org; Sat, 10 Nov 2007 08:52:52 -0500 Received: from fwd30.aul.t-online.de by mailout04.sul.t-online.com with smtp id 1IqqlV-0007bz-03; Sat, 10 Nov 2007 14:52:49 +0100 Received: from [10.3.2.2] (S+OxCwZ6ghMr0MB9icS-uSEG8oaiefEkDrPhQWeIDH114ZrXc+sMwF8AkK6Q9MOZK5@[217.235.244.239]) by fwd30.aul.t-online.de with esmtp id 1IqqlM-2ASdiy0; Sat, 10 Nov 2007 14:52:40 +0100 Message-ID: <4735B7A4.2060007@t-online.de> Date: Sat, 10 Nov 2007 14:52:36 +0100 From: Christian Franke User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070802 SeaMonkey/1.1.4 MIME-Version: 1.0 To: The development of GRUB 2 References: <4720F3CA.7070804@t-online.de> <20071109205638.GB23437@thorin> <87bqa3jezk.fsf@xs4all.nl> <20071109212508.GE23437@thorin> In-Reply-To: <20071109212508.GE23437@thorin> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-ID: S+OxCwZ6ghMr0MB9icS-uSEG8oaiefEkDrPhQWeIDH114ZrXc+sMwF8AkK6Q9MOZK5 X-TOI-MSGID: 131f4fb8-5588-46be-99ec-227dc00641d7 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Subject: Re: [PATCH] Add host open devicename check X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Nov 2007 13:52:54 -0000 Robert Millan wrote: > On Fri, Nov 09, 2007 at 10:17:19PM +0100, Marco Gerards wrote: > >> Robert Millan 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