From d6e07aa5d6233f8e7783cdf5e635ee85a64e94b6 Mon Sep 17 00:00:00 2001 From: liyuan Date: Fri, 22 Dec 2023 05:44:16 +0800 Subject: [PATCH] backport Fix 32 bit build --- 0001-Fix-32-bit-build.patch | 28 ++++++++++++++++++++++++++++ mokutil.spec | 7 ++++++- 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 0001-Fix-32-bit-build.patch diff --git a/0001-Fix-32-bit-build.patch b/0001-Fix-32-bit-build.patch new file mode 100644 index 0000000..834fb6e --- /dev/null +++ b/0001-Fix-32-bit-build.patch @@ -0,0 +1,28 @@ +From 21c15dade84cb43831b05403fa31bc36229c2979 Mon Sep 17 00:00:00 2001 +From: Andy Postnikov +Date: Sun, 14 Jun 2020 20:12:52 +0300 +Subject: [PATCH] Fix 32 bit build + +Other function integers are unsigned but size_t looks better fit + +Closes #28 +--- + src/mokutil.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/mokutil.c b/src/mokutil.c +index 570de06..110676d 100644 +--- a/src/mokutil.c ++++ b/src/mokutil.c +@@ -2011,7 +2011,7 @@ generate_pw_hash (const char *input_pw) + char *password = NULL; + char *crypt_string; + const char *prefix; +- int settings_len = sizeof (settings) - 2; ++ size_t settings_len = sizeof (settings) - 2; + unsigned int pw_len, salt_size; + + if (input_pw) { +-- +2.33.0 + diff --git a/mokutil.spec b/mokutil.spec index 1917fe5..ac6ffe2 100644 --- a/mokutil.spec +++ b/mokutil.spec @@ -1,12 +1,14 @@ Name: mokutil Version: 0.4.0 -Release: 1 +Release: 2 Epoch: 1 Summary: Tools for manipulating machine owner keys License: GPLv3+ URL: https://github.com/lcp/mokutil Source0: https://github.com/lcp/mokutil/archive/%{version}.tar.gz +Patch0001: 0001-Fix-32-bit-build.patch + BuildRequires:gcc autoconf automake gnu-efi git openssl-devel openssl efivar-devel >= 31-1 git Conflicts: shim < 0.8-1 Obsoletes: mokutil < 0.2.0 @@ -57,6 +59,9 @@ make check %{_mandir}/man1/* %changelog +* Fri Dec 29 2023 liyuanyuan - 1:0.4.0-2 +- Fix 32 bit build + * Sat Jan 11 2020 openEuler Buildteam - 1:0.4.0-1 - Update to 0.4.0 -- Gitee