[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:54:06 +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=yFsBgP0I2lsEjEXUSrhbALEWBDLafndh5axRrWRGhI8=; b=hpLZvAtN7cxkHj/+OW/HHif2XBVAfXNnIwYPkWWTG9Zf5Kj1pS+qvXez2Z1DAipr+Dh6BecK8XbitrWLL2CSSApKV3r1aiAg08SRdpO5tGDm+dRyZaYs5ssRQ4pXG0iqDsTNLraSvyA23HxK6WPL8GdKQUBrJOG28+C43XKwJbW7vM43zyONRcJE10ynAmWAMWpiHU85+tQAMTRnKmREYDndOpFQukyilttTRnQJZvkv+wvSbiei6cbKTYrKIIJFxcHihs4eGKQXt/8w0Oqgu2O9VHKXiFdKFexkJmvff7v3XZfrBWVSjCaH2hfcD2UWWGfR4ry54S6SZ0Gtl6z19A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BbD7bnqCOvGpWwjNZrUots+mmoxPVutc3fQxxsORVnH4PaFTnRVSRyAbGYotb6U6QJDepcekfDRQcY4V4kDzZYo5u0R85XQzzMSPu4ra0YjKX690EbIx7JHpnElmIOknNgprGakw4QAG/owshgZLBdDAFPDNMNGFoLnuuzb3j3rlWmStCo0fjqe1g7AE8q+y/VlTjUDGNCU9H1aydvZU3TDd8ccSPmDQu+YIYTzNemTpRsArS1/oqssBV6j7kKXAHX6bEaC2sfjJQpuw7mPQmvJn+77Pu3t4ua9onesvkNnAoG5QA8ffYDPQ1WafeE5M7RfmvSFo97vABUs3kkgSQg==
  • 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:54:13 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 08.08.2023 15:36, Juergen Gross wrote:
> On 08.08.23 15:32, Jan Beulich wrote:
>> 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"?
> 
> "pygrub" is the preferred variant, "/usr/bin/pygrub" seems to be the
> legacy variant, which will result in a warning to use "pygrub" only
> (in case pygrub is enabled, of course).
> 
> I don't think we should test for other non-standard paths.
> 
>>
>>> +        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.
> 
> It would be possible to use that in case it is e.g. installed in
> /usr/local/bin/pygrub (assuming the check above isn't modified).

Well, okay, I'll leave this to Anthony then.

Jan



 


Rackspace

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