From 38918ed06ed557e2e650fbc772ddaad2267ad0e3 Mon Sep 17 00:00:00 2001 From: bailu Date: Mon, 4 Aug 2025 10:14:40 +0800 Subject: [PATCH] backport from fedoraproject to port to C99 Signed-off-by: liuqingtao (cherry picked from commit 84040b3b9ac3914105b4369e290ddafa0b688552) --- amanda-c99.patch | 30 ++++++++++++++++++++++++++++++ amanda.spec | 6 +++++- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 amanda-c99.patch diff --git a/amanda-c99.patch b/amanda-c99.patch new file mode 100644 index 0000000..6db3c84 --- /dev/null +++ b/amanda-c99.patch @@ -0,0 +1,30 @@ +Fix C type safety issue in CVE-2023-30547 change + +The types char ** and const char ** are distinct according to the +C language. Future compilers will treat pointer type mismatches +as errors. + +Submitted upstream: + +diff --git a/client-src/runtar.c b/client-src/runtar.c +index 454e9b9a9b96449b..4d2451dc84840fa9 100644 +--- a/client-src/runtar.c ++++ b/client-src/runtar.c +@@ -54,7 +54,7 @@ main( + { + #ifdef GNUTAR + int i; +- char **j; ++ const char **j; + char *e; + char *dbf; + char *cmdline; +@@ -255,7 +255,7 @@ check_whitelist( + gchar* option) + { + bool result = TRUE; +- char** i; ++ const char** i; + + for(i=whitelisted_args; *i; i++) { + if (g_str_has_prefix(option, *i)) { diff --git a/amanda.spec b/amanda.spec index 0866743..a07b46f 100644 --- a/amanda.spec +++ b/amanda.spec @@ -9,7 +9,7 @@ Name: amanda Version: 3.5.4 -Release: 2 +Release: 3 Summary: A backup solution over network to disk License: BSD and GPLv3+ and GPLv2+ and GPLv2 URL: http://www.amanda.org @@ -33,6 +33,7 @@ Patch3: amanda-3.2.0-config-dir.patch Patch4: amanda-3.4.5-no-xinetd.patch # Support tirpc Patch5: patch-tirpc.patch +patch6: amanda-c99.patch BuildRequires: automake autoconf libtool dump xfsdump cups BuildRequires: samba-client tar grep gcc-c++ readline-devel libtirpc-devel @@ -320,6 +321,9 @@ make check %{_mandir}/man* %changelog +* Fri Aug 01 2025 liuqingtao 3.5.4-3 +- backport from fedoraproject to port to C99 + * Fri Sep 6 2024 liyanan - 3.5.4-2 - Delete the build dependency gnuplot does not build amplot -- Gitee