From 2e8884427385c2832bc2272af2b420ed02ed9932 Mon Sep 17 00:00:00 2001 From: Robbie Harwood Date: Mon, 23 May 2022 18:43:41 +0000 Subject: [PATCH] Fix abort on unknown argument Resolves: #2087066 Signed-off-by: Robbie Harwood --- ...age-instead-of-aborting-on-bad-flags.patch | 31 +++++++++++++++++++ mokutil.patches | 1 + mokutil.spec | 7 ++++- 3 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 0001-Show-usage-instead-of-aborting-on-bad-flags.patch create mode 100644 mokutil.patches diff --git a/0001-Show-usage-instead-of-aborting-on-bad-flags.patch b/0001-Show-usage-instead-of-aborting-on-bad-flags.patch new file mode 100644 index 0000000..0f7fda1 --- /dev/null +++ b/0001-Show-usage-instead-of-aborting-on-bad-flags.patch @@ -0,0 +1,31 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Robbie Harwood +Date: Tue, 17 May 2022 11:23:28 -0400 +Subject: [PATCH] Show usage instead of aborting on bad flags + +Aborting here just confuses users and is sufficiently unexpected to +cause the filing of bugs. + +Related: https://bugzilla.redhat.com/show_bug.cgi?id=2087066 +Signed-off-by: Robbie Harwood +(cherry picked from commit 82694cb1ce3b29c3705c25ae4cea3d07fe57b558) +--- + src/mokutil.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/src/mokutil.c b/src/mokutil.c +index 5d725c9..e8228af 100644 +--- a/src/mokutil.c ++++ b/src/mokutil.c +@@ -2087,10 +2087,9 @@ main (int argc, char *argv[]) + goto out; + case 'h': + case '?': ++ default: + command |= HELP; + break; +- default: +- abort (); + } + } + diff --git a/mokutil.patches b/mokutil.patches new file mode 100644 index 0000000..dc41221 --- /dev/null +++ b/mokutil.patches @@ -0,0 +1 @@ +Patch0001: 0001-Show-usage-instead-of-aborting-on-bad-flags.patch diff --git a/mokutil.spec b/mokutil.spec index b2417d8..c7a9309 100644 --- a/mokutil.spec +++ b/mokutil.spec @@ -1,11 +1,12 @@ Name: mokutil Version: 0.6.0 -Release: 1%{?dist} +Release: 2%{?dist} Epoch: 2 Summary: Tool to manage UEFI Secure Boot MoK Keys License: GPLv3+ URL: https://github.com/lcp/mokutil Source0: https://github.com/lcp/mokutil/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz +Source1: mokutil.patches ExclusiveArch: %{ix86} x86_64 aarch64 %{arm} BuildRequires: autoconf @@ -43,6 +44,10 @@ mokutil provides a tool to manage keys for Secure Boot through the MoK %{_datadir}/bash-completion/completions/mokutil %changelog +* Mon May 23 2022 Robbie Harwood - 2:0.6.0-2 +- Fix abort on unknown argument +- Resolves: #2087066 + * Sat May 07 2022 Peter Robinson - 2:0.6.0-1 - Update to 0.6.0 release