s390utils/s390utils-2.17.0-rhel.patch

111 lines
3.3 KiB
Diff

From 66cca7c6765be5a5207315a8df6de599bba306cb Mon Sep 17 00:00:00 2001
From: Alexander Egorenkov <egorenar@linux.ibm.com>
Date: Wed, 21 Jul 2021 17:22:29 +0200
Subject: [PATCH 1/2] hsavmcore: Avoid recompilation of overlay during install
step
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
overlay.o was being recompiled during the install step because
it depended on the target check-dep-fuse which is phony and,
therefore, always outdated. The solution is to create an empty file
for the target check-dep-fuse after its successful completion. This
prevents make from rebuilding overlay.o during installation.
Closes: https://github.com/ibm-s390-linux/s390-tools/pull/118
Fixes: 5a7d2a58c8b3 ("hsavmcore: Fix fuse dependency checking")
Signed-off-by: Alexander Egorenkov <egorenar@linux.ibm.com>
Suggested-by: Ingo Franzki <ifranzki@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
(cherry picked from commit 80cb1553a30d7804d1521691e9b178c7613eaa8c)
---
hsavmcore/Makefile | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/hsavmcore/Makefile b/hsavmcore/Makefile
index 7c1d4fd..82e6abc 100644
--- a/hsavmcore/Makefile
+++ b/hsavmcore/Makefile
@@ -69,6 +69,7 @@ check-dep-fuse:
"fuse.h", \
"fuse-devel or libfuse-dev", \
"HAVE_FUSE=0")
+ touch check-dep-fuse
install: all
$(INSTALL) -g $(GROUP) -o $(OWNER) -m 755 hsavmcore \
@@ -81,6 +82,6 @@ install: all
endif # HAVE_FUSE
clean:
- rm -f hsavmcore $(objects)
+ rm -f hsavmcore $(objects) check-dep-fuse
.PHONY: all install clean
--
2.31.1
From f6f24d191ed29a1c6d49c1339e09f21fe7d24c19 Mon Sep 17 00:00:00 2001
From: Ingo Franzki <ifranzki@linux.ibm.com>
Date: Mon, 12 Jul 2021 13:20:52 +0200
Subject: [PATCH 2/2] libkmipclient: Fix parsing of hex values for XML and JSON
encoding (#1870700)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
KMIP values of type BYTE-STRING are represented as hex values when XML
or JSON encoding is used. Do not drop any leading zero bytes, if the
value has them.
Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
(cherry picked from commit d2a4a8b0f3f24a19bd0363b5a4f264b50ac4a885)
---
libkmipclient/utils.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/libkmipclient/utils.c b/libkmipclient/utils.c
index 4a88d0c..dbd03fd 100644
--- a/libkmipclient/utils.c
+++ b/libkmipclient/utils.c
@@ -125,7 +125,7 @@ int kmip_parse_hex(const char *str, bool has_prefix, unsigned char **val,
{
unsigned char *buf;
BIGNUM *b = NULL;
- int len, rc;
+ int len;
if (str == NULL)
return -EINVAL;
@@ -133,18 +133,20 @@ int kmip_parse_hex(const char *str, bool has_prefix, unsigned char **val,
if (has_prefix && strncmp(str, "0x", 2) != 0)
return -EBADMSG;
- rc = BN_hex2bn(&b, str + (has_prefix ? 2 : 0));
- if (rc <= 0)
+ len = BN_hex2bn(&b, str + (has_prefix ? 2 : 0));
+ if (len <= 0)
+ return -EBADMSG;
+ if (len < (int)strlen(str) - (has_prefix ? 2 : 0))
return -EBADMSG;
- len = BN_num_bytes(b);
+ len = len / 2 + (len % 2 > 0 ? 1 : 0);
buf = calloc(1, len);
if (buf == NULL) {
BN_free(b);
return -ENOMEM;
}
- if (BN_bn2bin(b, buf) != len) {
+ if (BN_bn2binpad(b, buf, len) != len) {
BN_free(b);
free(buf);
return -EIO;
--
2.31.1