From nobody Fri May 3 04:10:18 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+40044+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+40044+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1557153406; cv=none; d=zoho.com; s=zohoarc; b=LMn08yPNtRHcDG2vZD8zB4g9hXtiKcati87cMrt78+wyWsw/T7TIXdpSi0AlzxtZZmV8TQzIqzFD9PsX5bvQPIkfm7XirBZ/2e7IygNDew3vmZOYwOUD8fdTPyMD1T8+7pB4fsQbgdNMBd/NDOM0w/0+GR5fdJ2YByMl19wvf4o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557153406; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=6u7mHc93TOBfpAWJsDdY4PUsIYqzGJoRuYpulFAFiDM=; b=grM2tQpx7zewT3V520YhSwdzSgmMjX0XF3jQVVj7qhWQlWRlLJSf9uVQaXB90D/LjsWDHBtDAAcfN5sNCsCQO1Wf+ssjArt8FdSon6iHBrs+K0tjgGN405lGYBS/SO63Dh5iFYmkFhf1NUa7/ygwj6jDfhW+7Uj7jgjfl0IGpPo= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+40044+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1557153406404484.6391037620714; Mon, 6 May 2019 07:36:46 -0700 (PDT) Return-Path: X-Received: from gecko.birch.relay.mailchannels.net (gecko.birch.relay.mailchannels.net [23.83.209.66]) by groups.io with SMTP; Mon, 06 May 2019 06:03:08 -0700 X-Sender-Id: dreamhost|x-authsender|jwatt@jwatt.org X-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 7DAC66A1B51; Mon, 6 May 2019 13:03:07 +0000 (UTC) X-Received: from pdx1-sub0-mail-a76.g.dreamhost.com (100-96-79-5.trex.outbound.svc.cluster.local [100.96.79.5]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id CEA4D6A2107; Mon, 6 May 2019 13:03:06 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jwatt@jwatt.org X-Received: from pdx1-sub0-mail-a76.g.dreamhost.com ([TEMPUNAVAIL]. [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.17.2); Mon, 06 May 2019 13:03:07 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jwatt@jwatt.org X-MailChannels-Auth-Id: dreamhost X-Bottle-Occur: 432924063d86df67_1557147787277_3759120615 X-MC-Loop-Signature: 1557147787277:3705019907 X-MC-Ingress-Time: 1557147787276 X-Received: from pdx1-sub0-mail-a76.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a76.g.dreamhost.com (Postfix) with ESMTP id B102780212; Mon, 6 May 2019 06:03:03 -0700 (PDT) X-Received: from 82.40.106.149 (cpc120804-nrwh12-2-0-cust660.4-4.cable.virginm.net [82.40.106.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: jwatt@jwatt.org) by pdx1-sub0-mail-a76.g.dreamhost.com (Postfix) with ESMTPSA id F26CE800E6; Mon, 6 May 2019 06:02:59 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a76 From: "Jonathan Watt" To: devel@edk2.groups.io Cc: Jaben Carsey , Ray Ni Subject: [edk2-devel] [PATCH v1 1/1] ShellPkg/UefiShellBcfgCommandLib: Fix '-opt' option Date: Mon, 6 May 2019 14:02:57 +0100 Message-Id: <20190506130257.80722-2-jwatt@jwatt.org> In-Reply-To: <20190506130257.80722-1-jwatt@jwatt.org> References: <20190506130257.80722-1-jwatt@jwatt.org> MIME-Version: 1.0 X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduuddrjeejgdeiudcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepjhifrghtthesjhifrghtthdrohhrghenucfkphepkedvrdegtddruddtiedrudegleenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepkedvrdegtddruddtiedrudegledpihhnvghtpeekvddrgedtrddutdeirddugeelpdhrvghtuhhrnhdqphgrthhhpehjfigrthhtsehjfigrthhtrdhorhhgpdhmrghilhhfrhhomhepjhifrghtthesjhifrghtthdrohhrghdpnhhrtghpthhtoheprhgrhidrnhhisehinhhtvghlrdgtohhmnecuvehluhhsthgvrhfuihiivgeptd Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,jwatt@jwatt.org Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1557153406; bh=Q5nOhPB5vDG9jJtfaDGvp4EVcg+1Krz2AaQiX/A6rYA=; h=Cc:Date:From:Reply-To:Subject:To; b=uHY4y+OqGTie9cFE1QHKGL4zsxVNCgdutbEQRGzjvBdMD0z1u3PIM2ZrU7XM/UK7nqM PXCx+UIuLVQS8Swn2Di3++mV7sFkcLZw36a+gzrLdobASrKYzLljbN1mQj0/21UL+Q2HJ MDmqfvhHpMGy0NS+8y/Z0I4P1zvILJaFEs4= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Jonathan Watt For all other bcfg commands the "#" (option number) argument(s) are treated as hexedecimal values regardless of whether or not they are prefixed by "0x". This change fixes '-opt' to handle its "#" (option number) argument consistently with the other commands. Making this change removes a potential footgun whereby a user that has been using a number without a "0x" prefix with other bcfg commands finds that, on using that exact same number with '-opt', it has this time unexpectedly been interpreted as a decimal number and they have modified (corrupted) an unrelated load option. For example, a user may have been specifying "10" to other commands to have them act on the 16th option (because simply "10", without any prefix, is how 'bcfg boot dump' displayed the option number for the 16th option). Unfortunately for them, if they also use '-opt' with "10" it would unexpectedly and inconsistently act on the 10th option. CC: Jaben Carsey CC: Ray Ni Signed-off-by: Jonathan Watt Reviewed-by: Bi Dandan Reviewed-by: Jaben Carsey Reviewed-by: Zhichao Gao --- ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandL= ib.c b/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c index d033c7c1dc59..e8b48b4990dd 100644 --- a/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c +++ b/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c @@ -1019,7 +1019,7 @@ BcfgAddOpt( // // Get the index of the variable we are changing. // - Status =3D ShellConvertStringToUint64(Walker, &Intermediate, FALSE, TRUE= ); + Status =3D ShellConvertStringToUint64(Walker, &Intermediate, TRUE, TRUE); if (EFI_ERROR(Status) || (((UINT16)Intermediate) !=3D Intermediate) || S= trStr(Walker, L" ") =3D=3D NULL || ((UINT16)Intermediate) > ((UINT16)OrderC= ount)) { ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShell= BcfgHiiHandle, L"bcfg", L"Option Index"); ShellStatus =3D SHELL_INVALID_PARAMETER; --=20 2.21.0 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#40044): https://edk2.groups.io/g/devel/message/40044 Mute This Topic: https://groups.io/mt/31520134/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-