From c70cfe10e9104b67e6e3dccadb35210f5452bf93 Mon Sep 17 00:00:00 2001 From: caodongxia <315816521@qq.com> Date: Fri, 11 Nov 2022 10:08:22 +0800 Subject: [PATCH] fix hexencode test failed (cherry picked from commit d4c51505cd3242b8a918b20f842f459b2179dc29) --- ...test-case-as-it-fails-with-new-glib2.patch | 12 --------- amanda.spec | 8 ++++-- fix-hexencode-test.patch | 27 +++++++++++++++++++ 3 files changed, 33 insertions(+), 14 deletions(-) delete mode 100644 Skip-hexencode-test-case-as-it-fails-with-new-glib2.patch create mode 100644 fix-hexencode-test.patch diff --git a/Skip-hexencode-test-case-as-it-fails-with-new-glib2.patch b/Skip-hexencode-test-case-as-it-fails-with-new-glib2.patch deleted file mode 100644 index 112e888..0000000 --- a/Skip-hexencode-test-case-as-it-fails-with-new-glib2.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Nur a/common-src/Makefile.am b/common-src/Makefile.am ---- a/common-src/Makefile.am 2017-12-01 21:26:28.000000000 +0800 -+++ b/common-src/Makefile.am 2022-06-20 11:30:35.792590848 +0800 -@@ -246,7 +246,7 @@ - # automake-style tests - - TESTS = amflock-test event-test amsemaphore-test crc32-test quoting-test \ -- ipc-binary-test hexencode-test fileheader-test match-test -+ ipc-binary-test fileheader-test match-test - noinst_PROGRAMS = $(TESTS) - - amflock_test_SOURCES = amflock-test.c diff --git a/amanda.spec b/amanda.spec index 8eae2d9..dd3c0f6 100644 --- a/amanda.spec +++ b/amanda.spec @@ -9,7 +9,7 @@ Name: amanda Version: 3.5.1 -Release: 20 +Release: 21 Summary: A backup solution over network to disk License: BSD and GPLv3+ and GPLv2+ and GPLv2 URL: http://www.amanda.org @@ -25,7 +25,8 @@ Source16: kamanda@.service Patch5: patch-tirpc Patch6: fix-multiple-definition.patch -Patch7: Skip-hexencode-test-case-as-it-fails-with-new-glib2.patch +#Refer: https://github.com/zmanda/amanda/pull/176/ +Patch7: fix-hexencode-test.patch BuildRequires: automake autoconf libtool dump xfsdump cups BuildRequires: samba-client tar grep gcc-c++ readline-devel libtirpc-devel @@ -195,6 +196,9 @@ make check %{_mandir}/man* %changelog +* Fri Nov 11 2022 caodongxia - 3.5.1-21 +- fix hexencode test failed + * Mon Jun 20 2022 liyanan - 3.5.1-20 - Skip hexencode test case as it fails with new glib2 diff --git a/fix-hexencode-test.patch b/fix-hexencode-test.patch new file mode 100644 index 0000000..9fcc9d3 --- /dev/null +++ b/fix-hexencode-test.patch @@ -0,0 +1,27 @@ +From 262c05b20c7de243542e7502e00152cdafb573d4 Mon Sep 17 00:00:00 2001 +From: Peter Bieringer +Date: Wed, 6 Jul 2022 22:53:12 +0200 +Subject: [PATCH] fix for https://github.com/zmanda/amanda/issues/167 + +--- + common-src/amutil.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/common-src/amutil.c b/common-src/amutil.c +index 20454ab73c..371d38e433 100644 +--- a/common-src/amutil.c ++++ b/common-src/amutil.c +@@ -1132,6 +1132,12 @@ char *hexdecode_string(const char *str, GError **err) + new_len = orig_len = strlen(str); + for (i = 0; i < orig_len; i++) { + if (str[i] == '%') { ++ if (new_len < 2) { ++ g_set_error(err, am_util_error_quark(), AM_UTIL_ERROR_HEXDECODEINVAL, ++ "Invalid hexcode string: %s", str); ++ s = g_string_sized_new(0); ++ goto cleanup; ++ } + new_len -= 2; + } + } + \ No newline at end of file -- Gitee