[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 3/3] tools/xl: reject bootloader=pygrub in case pygrub is disabled


  • To: Juergen Gross <jgross@xxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 8 Aug 2023 15:32:11 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=LS9EXPu1kaxGyZ2rFP39sKzgFC+GHstcRYigC+hlzEY=; b=CCeMbAtQWPBfveboVRndnpdg5Y4omnyAF7Gf35ywPeDUEQH0vbb1CQGxSSFwGjEv/bFoBd6s2c0nl82LBuytkCpVtEwfaQHNHVKTwimh5aYK7HwLMlLEwMdt+B0LLoC0WjV9B2CW9My4iAWTDuDEbUntJKD+T23aSMN3Uz/vs0q/9uw8ZP90TtZxaIsmGFP9YAUDh9KsWiV0H+MAmMxCP+QNBwqytYPcQfSUJTNb4FlHv1meu59vCgkBOSaaqPLsSdn1dODVT1YVDNqfqwfrtkIHVbQh7RHYKmpa5Mwe4ORS0Ehj5zuYdQ9Pff89Icjbt+qLUg7TvdVDm3JwqL7rPA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ogQO7KvVI/FS5SIg4I1vNsElA8VD9SOHk1NN77XcDSasjaNp+M9DKAsoTRQ6944YrE+lPdGHo5ri7T+D55lmoITb2+lCeDiTlP7IDNBGZIx23Jc7XjGlvLw9l4OMXK67arIUpoeKV2CVlpk21CMXsq2rJCoCUsWg3eTEazJZlMkKSqt0zW4NHZXQY8ffabJklhCg14lsZEpgOGj6RAISS5ZbzBblOubt1rzM74m+nsX2AyovpNEmDS/HFdegw7NGtRdwl1zgtHndgwQYo0olWoyRP6qMuhNRLj5qpCsuGvEEoW7iHy7JBDoQHu2xapIydwkztUHbmnhpGpiLPwZ6Vw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Wei Liu <wl@xxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Tue, 08 Aug 2023 13:32:26 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 08.08.2023 15:22, Juergen Gross wrote:
> --- a/tools/xl/xl_parse.c
> +++ b/tools/xl/xl_parse.c
> @@ -1692,6 +1692,15 @@ void parse_config_data(const char *config_source,
>      xlu_cfg_get_defbool(config, "acpi", &b_info->acpi, 0);
>  
>      xlu_cfg_replace_string (config, "bootloader", &b_info->bootloader, 0);
> +#ifndef HAVE_PYGRUB
> +    if (b_info->bootloader &&
> +        (!strcmp(b_info->bootloader, "pygrub") ||
> +      !strcmp(b_info->bootloader, "/usr/bin/pygrub"))) {

And no other path combinations can occur? strstr() is perhaps too lax,
but what about finding the last slash (if any) and comparing the rest
of the string (the full string when there's no slash) against "pygrub"?

> +        fprintf(stderr, "ERROR: this instance of Xen has been built without 
> support of \"pygrub\".\n");

The other question (I'm sorry for my ignorance here) is whether pygrub
could come from anywhere else.

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.