From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1SNqB1-00024i-Lf for mharc-grub-devel@gnu.org; Fri, 27 Apr 2012 14:45:55 -0400 Received: from eggs.gnu.org ([208.118.235.92]:54294) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SNqAz-00024I-47 for grub-devel@gnu.org; Fri, 27 Apr 2012 14:45:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SNqAx-0003mG-7p for grub-devel@gnu.org; Fri, 27 Apr 2012 14:45:52 -0400 Received: from mail-we0-f169.google.com ([74.125.82.169]:54837) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SNqAw-0003lN-VT for grub-devel@gnu.org; Fri, 27 Apr 2012 14:45:51 -0400 Received: by werj55 with SMTP id j55so822508wer.0 for ; Fri, 27 Apr 2012 11:45:49 -0700 (PDT) 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:x-enigmail-version:content-type; bh=GBA4J1CwT/XMgRnECy8OL8bqrYltCox5J3AqAHzelpQ=; b=CptsBXLPpLkA9wL8nOqAGPlYDiRVWS7I+BugBftX1+lUPEZhNF4pHQaQiZmPaDbqbW tn5VLpk1gNpIwbBAXKfPKBtbJaWf7nmH3tWu1ftWemoRmUv72CyUocSp+PG+uuZNLQqE kIRm6MZgTXTo9uZDpIB8VFL3gj3hkb78PFqTfoshm0YFx2dCQELJVq2kgfMITUlpCHNo vauQair0RZZmAgUhIvExIQIiTGEaS4L7tEQyjx0n9GypeScWF2cQFkSE4BM249egaaOk 5Av6zysCF+7mXkzUErVoyB1hx3svXlU6OXwTyxKibivwG4IQLhzTnAhp5aER73AsUQS8 HWAg== Received: by 10.216.139.194 with SMTP id c44mr7552105wej.112.1335552347825; Fri, 27 Apr 2012 11:45:47 -0700 (PDT) Received: from debian.x201.phnet (176-207.77-83.cust.bluewin.ch. [83.77.207.176]) by mx.google.com with ESMTPS id ff2sm10250748wib.9.2012.04.27.11.45.44 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 27 Apr 2012 11:45:46 -0700 (PDT) Message-ID: <4F9AE957.1050209@gmail.com> Date: Fri, 27 Apr 2012 20:45:43 +0200 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.3) Gecko/20120329 Icedove/10.0.3 MIME-Version: 1.0 To: grub-devel@gnu.org Subject: Re: [PATCH,HURD] Fix grub-probe with userland partition support References: <20120424124220.GS4453@type.bordeaux.inria.fr> <4F96A85D.3040303@gmail.com> <20120424171358.GT4433@type.famille.thibault.fr> <4F9709A9.6090707@gmail.com> <20120424222110.GD29782@type.famille.thibault.fr> <4F9729BE.1060105@gmail.com> <20120424235202.GX29782@type.famille.thibault.fr> <4F973E02.9020700@gmail.com> <20120425002736.GB29782@type.famille.thibault.fr> <4F97B7AB.90400@gmail.com> <20120425093721.GX29782@type.famille.thibault.fr> In-Reply-To: <20120425093721.GX29782@type.famille.thibault.fr> X-Enigmail-Version: 1.4.1 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="------------enig89D8DC9AF0EF9604D25C2A23" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 74.125.82.169 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: Fri, 27 Apr 2012 18:45:54 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig89D8DC9AF0EF9604D25C2A23 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 25.04.2012 11:37, Samuel Thibault wrote: > + /* Make sure the string is terminated. */ > + argz[argz_len-1] =3D 0; This would fail if argz_len =3D=3D 0. You have to check this case. > + > + /* Skip first word (translator path) and options. */ > + for (i =3D strlen (&argz[0]) + 1; i < argz_len; i +=3D strlen (&argz= [i]) + 1) > + { please use argz and argz + i > + if (argz[i] !=3D '-') > + { > + /* Non-option. Only accept one, assumed to be the FS path. = */ > + /* XXX: this should be replaced by an RPC to the translator.= */ > + if (name) > + /* TRANSLATORS: we expect to get something like > + /hurd/foobar --option1 --option2=3Dbaz /dev/something > + */ > + grub_util_error (_("Translator `%s' for path `%s' has seve= ral " > + "non-option words, at least `%s' and `%= s'"), > + &argz[0], path, name, &argz[i]); > + name =3D &argz[i]; ditto > + } > + } > + > + if (!name) > + /* TRANSLATORS: we expect to get something like > + /hurd/foobar --option1 --option2=3Dbaz /dev/something > + */ > + grub_util_error (_("Translator `%s' for path `%s' is given only op= tions, " > + "cannot find device part"), &argz[0], path); > + > + if (!strncmp (name, "device:", strlen ("device:"))) Please use explicit =3D=3D 0 and use sizeof ("...")-1 instead of strlen o= n const string. > + { > + char *dev_name =3D name + strlen ("device:"); > + size_t size =3D strlen ("/dev/") + strlen (dev_name) + 1; > + ret =3D malloc (size); > + snprintf (ret, size, "/dev/%s", dev_name); stpcpy is more appropriate than snprintf here. > + } > + else if (!strncmp (name, "file:", strlen ("file:"))) > + ret =3D strdup (name + strlen ("file:")); > + else > + ret =3D strdup (name); > + > + munmap (argz, argz_len); > + return ret; --=20 Regards Vladimir '=CF=86-coder/phcoder' Serbinenko --------------enig89D8DC9AF0EF9604D25C2A23 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.12 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iF4EAREKAAYFAk+a6VcACgkQNak7dOguQgkjUQEAqBlhjDeM7dVTxgUnGq6gridS iE1cp7q8so9R5MdLSmMA/0Hf8HpQJB+ay5tJ4uw4It2q3rAieiv9jZL1plJpyKHT =NzTo -----END PGP SIGNATURE----- --------------enig89D8DC9AF0EF9604D25C2A23--