]> git.proxmox.com Git - mirror_edk2.git/commit
ShellPkg/UefiShellBcfgCommandLib: Fix '-opt' option
authorJonathan Watt <jwatt@jwatt.org>
Tue, 7 May 2019 04:02:57 +0000 (21:02 -0700)
committerJaben Carsey <jaben.carsey@intel.com>
Mon, 5 Aug 2019 21:24:32 +0000 (14:24 -0700)
commit76e40d7be239893dbf9844515392779c3ab2fba0
tree087af148a53397eeb527e41934fbd292c7046bb4
parent7c662c9e73161d53cfd5bc8cda8a06ad2241ef00
ShellPkg/UefiShellBcfgCommandLib: Fix '-opt' option

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 <jaben.carsey@intel.com>
CC: Ray Ni <ray.ni@intel.com>
Signed-off-by: Jonathan Watt <jwatt@jwatt.org>
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Bi Dandan <dandan.bi@intel.com>
ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c