Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1GQSRN-0006cP-6Q for mharc-grub-devel@gnu.org; Thu, 21 Sep 2006 13:34:25 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GQSRK-0006WS-SO for grub-devel@gnu.org; Thu, 21 Sep 2006 13:34:22 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GQSRI-0006QT-Rw for grub-devel@gnu.org; Thu, 21 Sep 2006 13:34:22 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GQSRI-0006Pd-LC for grub-devel@gnu.org; Thu, 21 Sep 2006 13:34:20 -0400 Received: from [69.60.117.155] (helo=aybabtu.com) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1GQSUr-00018K-44 for grub-devel@gnu.org; Thu, 21 Sep 2006 13:38:01 -0400 Received: from 138.red-62-57-141.user.auna.net ([62.57.141.138] helo=khazad.dyndns.org) by aybabtu.com with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.63) (envelope-from ) id 1GQSR3-00060U-8y for grub-devel@gnu.org; Thu, 21 Sep 2006 19:34:05 +0200 Received: from rmh by khazad.dyndns.org with local (Exim 4.63) (envelope-from ) id 1GQSRI-0006hc-1n for grub-devel@gnu.org; Thu, 21 Sep 2006 19:34:20 +0200 Date: Thu, 21 Sep 2006 19:34:19 +0200 From: Robert Millan To: The development of GRUB 2 Message-ID: <20060921173419.GA25491@khazad.dyndns.org> References: <20060917203924.GA3073@khazad.dyndns.org> <200609210355.54781.okuji@enbug.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200609210355.54781.okuji@enbug.org> Organization: free as in freedom X-Message-Flag: Microsoft discourages use of Outlook. User-Agent: Mutt/1.5.13 (2006-08-11) Subject: Re: [PATCH] don't abort with error if realpath fails 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: Thu, 21 Sep 2006 17:34:23 -0000 On Thu, Sep 21, 2006 at 03:55:54AM +0200, Yoshinori K. Okuji wrote: > On Sunday 17 September 2006 22:39, Robert Millan wrote: > > Please consider (mostly useful to support device.map generated by GRUB > > legacy): > > > > 2006-09-17 Robert Millan > > > > * util/i386/pc/biosdisk.c (read_device_map): Don't abort with error if > > realpath fails (e.g. to cope with missing /dev/fd0 when we're aren't > > writing to floppy). > > Can you elaborate on the purpose? Personally I prefer a strict check for this > part, since the installation of GRUB is potentially very dangerous! Sure. The purpose of realpath here isn't really to verify device existance; that ought to happen later if (and only if) we're actualy going to use that device. Suppose this device.map: (hd0) /dev/hda (xxx) /dev/idontexist Theoricaly, when grub-setup is told to act on (hd0) it shouldn't care that /dev/idontexist doesn't exist (it could be listed because it was generated by an older grub, because the device disappeared, etc). However, because of the realpath canonicalisation, as a collateral result we get to abort if _any_ of the entries are wrong: #ifdef __linux__ /* On Linux, the devfs uses symbolic links horribly, and that confuses the interface very much, so use realpath to expand symbolic links. */ map[drive] = xmalloc (PATH_MAX); if (! realpath (p, map[drive])) grub_util_error ("Cannot get the real path of `%s'", p); #else map[drive] = xstrdup (p); #endif My point is that grub should be fault tollerant and not care that /dev/idontexist is broken, specialy since device.map is a file that is subject for input from either user or older grub (including grub legacy), and we have little control about its contents. -- Robert Millan My spam trap is honeypot@aybabtu.com. Note: this address is only intended for spam harvesters. Writing to it will get you added to my black list.