diff --git a/fix-caps-parameter-cannot-be-parsed.patch b/fix-caps-parameter-cannot-be-parsed.patch new file mode 100644 index 0000000000000000000000000000000000000000..1881b90e09964688bf095ef86e442aea451ed63b --- /dev/null +++ b/fix-caps-parameter-cannot-be-parsed.patch @@ -0,0 +1,33 @@ +From 40602a7926ec13819a5926d4ac451becb44b7d98 Mon Sep 17 00:00:00 2001 +From: shenxiangwei +Date: Fri, 19 Aug 2022 12:05:11 +0800 +Subject: [PATCH] fix caps parameter cannot be parsed + +Signed-off-by: shenxiangwei +--- + src/evmctl.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/evmctl.c b/src/evmctl.c +index 28f4b8d..6ef2f68 100644 +--- a/src/evmctl.c ++++ b/src/evmctl.c +@@ -440,13 +440,13 @@ static int calc_evm_hash(const char *file, unsigned char *hash) + } else if (!strcmp(*xattrname, XATTR_NAME_CAPS) && (hmac_flags & HMAC_FLAG_CAPS_SET)) { + if (!caps_str) + continue; +- err = strlen(caps_str); ++ hex2bin(xattr_value, caps_str, strlen(caps_str) >> 1); ++ err = strlen(caps_str) >> 1; + if (err >= sizeof(xattr_value)) { + log_err("caps[%u] value is too long to fit into xattr[%zu]\n", + err + 1, sizeof(xattr_value)); + return -1; + } +- strcpy(xattr_value, caps_str); + } else { + err = lgetxattr(file, *xattrname, xattr_value, sizeof(xattr_value)); + if (err < 0) { +-- +2.27.0 + diff --git a/ima-evm-utils.spec b/ima-evm-utils.spec index ea162bb528b5b6c6e58c680ec1397c1d3868d1ba..3a7b7b7862d2bb101b60ec4a52336cc5a221f88f 100644 --- a/ima-evm-utils.spec +++ b/ima-evm-utils.spec @@ -1,6 +1,6 @@ Name: ima-evm-utils Version: 1.3.1 -Release: 6 +Release: 7 Summary: IMA/EVM control utilities Group: System/Libraries License: GPLv2 @@ -8,6 +8,7 @@ URL: http://linux-ima.sourceforge.net/ Source0: http://sourceforge.net/projects/linux-ima/files/ima-evm-utils/%{name}-%{version}.tar.gz Patch9000: add-save-command-and-support-IMA-digest-list.patch +Patch9001: fix-caps-parameter-cannot-be-parsed.patch BuildRequires: autoconf automake libtool m4 asciidoc libxslt openssl-devel BuildRequires: keyutils-libs-devel git ima-evm-utils vim-common @@ -81,6 +82,9 @@ make check %doc %{_mandir}/*/* %changelog +* Fri Aug 19 2022 shenxiangwei - 1.3.1-7 +- Fix caps parameter cannot be parsed + * Mon May 31 2021 Anakin Zhang - 1.3.1-6 - fix make check issue