From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1VpO0Z-0004ce-Jc for mharc-grub-devel@gnu.org; Sat, 07 Dec 2013 14:57:47 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56016) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VpO0O-0004aI-8w for grub-devel@gnu.org; Sat, 07 Dec 2013 14:57:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VpO0E-000375-MJ for grub-devel@gnu.org; Sat, 07 Dec 2013 14:57:36 -0500 Received: from mail-ea0-x232.google.com ([2a00:1450:4013:c01::232]:51214) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VpO0E-00036t-Dt for grub-devel@gnu.org; Sat, 07 Dec 2013 14:57:26 -0500 Received: by mail-ea0-f178.google.com with SMTP id d10so882032eaj.9 for ; Sat, 07 Dec 2013 11:57:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type; bh=CqSr/DbGSSmX1qwMTH3eO4U6kO097+BoC//Pb4oN7l8=; b=tlHwkzq1gcUz2zKRXuJKjQGjmrvalRgx17kATOUf3ZUCvhj/kKLGZzgXD94t9qqtnw 8PJQ2V0ESg0Qcq8pQcDZL4R1o9P3X6/0+GqXxobtFVPxGJwiirQB7YwPSaUsKLIprsrF ernxSuBQjIITw5M5Kou7CYanl7GPkfngKY0n/KAGyok2PyEYbxAC8o2YZzhinfcTLSu3 kYol/xpR6RyqlXugYM6XVZAiAf6azuxEXH7i/5EDli5uWAfPg8v04PZZYfh+m+7QwFi/ DlDvaID5zHbECwz1jbVfJy+9BTZa+pXG/XCSsM9FySSP40Us+nIIfqMP4cH6QenmiAlb pWZA== X-Received: by 10.15.82.8 with SMTP id z8mr7237496eey.25.1386446245220; Sat, 07 Dec 2013 11:57:25 -0800 (PST) Received: from [192.168.1.16] (85-188.196-178.cust.bluewin.ch. [178.196.188.85]) by mx.google.com with ESMTPSA id h48sm9686181eev.3.2013.12.07.11.57.23 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 07 Dec 2013 11:57:24 -0800 (PST) Message-ID: <52A37D9C.2090905@gmail.com> Date: Sat, 07 Dec 2013 20:57:16 +0100 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131103 Icedove/17.0.10 MIME-Version: 1.0 To: The development of GNU GRUB Subject: Re: [PATCH] trivial fix for config_file without directory part References: <1386445914-18069-1-git-send-email-arvidjaar@gmail.com> In-Reply-To: <1386445914-18069-1-git-send-email-arvidjaar@gmail.com> X-Enigmail-Version: 1.6 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="4rHBDwrvDdUAvIR4kf7HFMIiRFjsAlQ68" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c01::232 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Dec 2013 19:57:45 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --4rHBDwrvDdUAvIR4kf7HFMIiRFjsAlQ68 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 07.12.2013 20:51, Andrey Borzenkov wrote: > It is legal to use "configfile " where filename doe= s > not contain directory part. In this case config_directory is set to fil= ename. > Set it to empty string so $config_directory/file works as expected. >=20 The only filenames valid in GRUB are of forms: [(device)]/path [(device)]blocklist All others are invalid even if the happend to be accepted by current version. > May be it makes sense to generate full pathname (including device part)= > so that interpretation of $config_directory does not depend on possible= > change of $root. >=20 > --- > grub-core/normal/main.c | 2 ++ > 1 file changed, 2 insertions(+) >=20 > diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c > index 991a595..16f22fb 100644 > --- a/grub-core/normal/main.c > +++ b/grub-core/normal/main.c > @@ -196,6 +196,8 @@ read_config_file (const char *config) > ptr =3D grub_strrchr (config_dir, '/'); > if (ptr) > *ptr =3D 0; > + else if (config_dir) > + *config_dir =3D 0; > grub_env_set ("config_directory", config_dir); > grub_free (config_dir); > =20 >=20 --4rHBDwrvDdUAvIR4kf7HFMIiRFjsAlQ68 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.15 (GNU/Linux) Comment: Using GnuPG with Icedove - http://www.enigmail.net/ iF4EAREKAAYFAlKjfaIACgkQmBXlbbo5nOusjgD7B5tYZAmqna48yhO9hB6SnlAf N7s4CiFithPdUB16Dm8A/iodJSGgj+dR0gDhQQyJdb2fKBREsi2ZUeapLlZP4/1J =BYB+ -----END PGP SIGNATURE----- --4rHBDwrvDdUAvIR4kf7HFMIiRFjsAlQ68--