diff --git a/.gitignore b/.gitignore index ca43e0b..8894779 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/mokutil-0.6.0.tar.gz +SOURCES/mokutil-0.7.2.tar.gz diff --git a/.mokutil.metadata b/.mokutil.metadata index ab6e9e9..c8b02e9 100644 --- a/.mokutil.metadata +++ b/.mokutil.metadata @@ -1 +1 @@ -b38fa41703cae749d8f642d3218cdff5d5d9a8ec SOURCES/mokutil-0.6.0.tar.gz +4c7863e8d39990a1d2f0aa6aac607a040014ea23 SOURCES/mokutil-0.7.2.tar.gz diff --git a/SOURCES/0001-Show-usage-instead-of-aborting-on-bad-flags.patch b/SOURCES/0001-Show-usage-instead-of-aborting-on-bad-flags.patch deleted file mode 100644 index 0f7fda1..0000000 --- a/SOURCES/0001-Show-usage-instead-of-aborting-on-bad-flags.patch +++ /dev/null @@ -1,31 +0,0 @@ -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/SOURCES/0002-mokutil-bugfix-del-unused-opt-s.patch b/SOURCES/0002-mokutil-bugfix-del-unused-opt-s.patch deleted file mode 100644 index a5ad40b..0000000 --- a/SOURCES/0002-mokutil-bugfix-del-unused-opt-s.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: gaoyusong -Date: Mon, 30 May 2022 17:54:47 +0800 -Subject: [PATCH] mokutil bugfix: del unused opt "-s" - -The -s option can cause unexcepted result. - -Signed-off-by: gaoyusong -(cherry picked from commit 04791c29e198b18808bca519267e31c8d3786a08) ---- - src/mokutil.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/mokutil.c b/src/mokutil.c -index e8228af..6982ade 100644 ---- a/src/mokutil.c -+++ b/src/mokutil.c -@@ -1851,7 +1851,7 @@ main (int argc, char *argv[]) - }; - - int option_index = 0; -- c = getopt_long (argc, argv, "cd:f:g::hi:lmpst:xDNPXv", -+ c = getopt_long (argc, argv, "cd:f:g::hi:lmpt:xDNPXv", - long_options, &option_index); - - if (c == -1) diff --git a/SOURCES/0003-Fix-leak-of-list-in-delete_data_from_req_var.patch b/SOURCES/0003-Fix-leak-of-list-in-delete_data_from_req_var.patch deleted file mode 100644 index 23633a8..0000000 --- a/SOURCES/0003-Fix-leak-of-list-in-delete_data_from_req_var.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Robbie Harwood -Date: Thu, 2 Jun 2022 12:56:31 -0400 -Subject: [PATCH] Fix leak of list in delete_data_from_req_var() - -Signed-off-by: Robbie Harwood -(cherry picked from commit d978c18f61b877afaab45a82d260b525423b8248) ---- - src/util.c | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/src/util.c b/src/util.c -index 621869f..6cd0302 100644 ---- a/src/util.c -+++ b/src/util.c -@@ -295,8 +295,10 @@ delete_data_from_req_var (const MokRequest req, const efi_guid_t *type, - } - - /* the key or hash is not in this list */ -- if (start == NULL) -- return 0; -+ if (start == NULL) { -+ ret = 0; -+ goto done; -+ } - - /* all keys are removed */ - if (total == 0) { diff --git a/SOURCES/0004-Fix-leak-of-fd-in-mok_get_variable.patch b/SOURCES/0004-Fix-leak-of-fd-in-mok_get_variable.patch deleted file mode 100644 index f1a48f6..0000000 --- a/SOURCES/0004-Fix-leak-of-fd-in-mok_get_variable.patch +++ /dev/null @@ -1,70 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Robbie Harwood -Date: Thu, 2 Jun 2022 13:00:22 -0400 -Subject: [PATCH] Fix leak of fd in mok_get_variable() - -On success, it was never closed. Refactor the code to use a single -egress path so its closure is clear. - -Signed-off-by: Robbie Harwood -(cherry picked from commit e498f6460ff5aea6a7cd61a33087d03e88a2f52a) ---- - src/util.c | 24 +++++++++++++----------- - 1 file changed, 13 insertions(+), 11 deletions(-) - -diff --git a/src/util.c b/src/util.c -index 6cd0302..f7fc033 100644 ---- a/src/util.c -+++ b/src/util.c -@@ -57,22 +57,21 @@ mok_get_variable(const char *name, uint8_t **datap, size_t *data_sizep) - return fd; - - rc = fstat(fd, &sb); -- if (rc < 0) { --err_close: -- close(fd); -- return rc; -- } -+ if (rc < 0) -+ goto done; - - if (sb.st_size == 0) { - errno = ENOENT; - rc = -1; -- goto err_close; -+ goto done; - } - - bufsz = sb.st_size; - buf = calloc(1, bufsz); -- if (!buf) -- goto err_close; -+ if (!buf) { -+ rc = -1; -+ goto done; -+ } - - while (pos < bufsz) { - ssz = read(fd, &buf[pos], bufsz - pos); -@@ -82,15 +81,18 @@ err_close: - errno == EINTR) - continue; - free(buf); -- goto err_close; -+ rc = -1; -+ goto done; - } - - pos += ssz; - } - *datap = buf; - *data_sizep = pos; -- -- return 0; -+ rc = 0; -+done: -+ close(fd); -+ return rc; - } - - MokListNode* diff --git a/SOURCES/mokutil.patches b/SOURCES/mokutil.patches index c450456..e69de29 100644 --- a/SOURCES/mokutil.patches +++ b/SOURCES/mokutil.patches @@ -1,4 +0,0 @@ -Patch0001: 0001-Show-usage-instead-of-aborting-on-bad-flags.patch -Patch0002: 0002-mokutil-bugfix-del-unused-opt-s.patch -Patch0003: 0003-Fix-leak-of-list-in-delete_data_from_req_var.patch -Patch0004: 0004-Fix-leak-of-fd-in-mok_get_variable.patch diff --git a/SPECS/mokutil.spec b/SPECS/mokutil.spec index b61e783..925aa4f 100644 --- a/SPECS/mokutil.spec +++ b/SPECS/mokutil.spec @@ -1,6 +1,6 @@ Name: mokutil -Version: 0.6.0 -Release: 4%{?dist} +Version: 0.7.2 +Release: 1%{?dist} Epoch: 2 Summary: Tool to manage UEFI Secure Boot MoK Keys License: GPLv3+ @@ -47,6 +47,10 @@ mokutil provides a tool to manage keys for Secure Boot through the MoK %{_datadir}/bash-completion/completions/mokutil %changelog +* Mon Apr 28 2025 Leo Sandoval - 0.7.2-1 +- Bump version to 0.7.2 upstream tag +- Resolves: #RHEL-88741 + * Thu Oct 27 2022 Robbie Harwood - 2:0.6.0-4 - Sync with Fedora at same NVR - Resolves: #2084621