Skip to content

Commit

Permalink
BaseTools/GenerateCapsule.py: Require --output for --decode
Browse files Browse the repository at this point in the history
--decode unconditionally uses args.OutputFile.name as a prefix for
output files that it creates and fails in a non-pretty way without
--output option.

This doesn't address creation/truncation of the file specified via
--output, but at least you're able to decode a capsule.

Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
  • Loading branch information
SergiiDmytruk authored and mergify[bot] committed Jul 5, 2024
1 parent 822ff96 commit 47c1078
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions BaseTools/Source/Python/Capsule/GenerateCapsule.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,10 @@ def Validate(self, args):
else:
raise argparse.ArgumentTypeError ('--update-image-index must be an integer in range 0x1..0xff')

if args.Decode:
if args.OutputFile is None:
raise argparse.ArgumentTypeError ('--decode requires --output')

if self.UseSignTool:
if self.SignToolPfxFile is not None:
self.SignToolPfxFile.close()
Expand Down

0 comments on commit 47c1078

Please sign in to comment.