From 6bd250bfdc6fea23112775f667b634ccff40ab00 Mon Sep 17 00:00:00 2001 From: DJ Delorie Date: Thu, 20 Apr 2023 01:34:48 -0400 Subject: [PATCH] Fix C99 compatibility issue Related to: Upstream commit: https://github.com/cyrusimap/cyrus-sasl/commit/266f0acf7f5e029afbb3e263437039e50cd6c262 --- cyrus-sasl-2.1.28-fedora-c99.patch | 53 ++++++++++++++++++++++++++++++ cyrus-sasl.spec | 2 ++ 2 files changed, 55 insertions(+) create mode 100644 cyrus-sasl-2.1.28-fedora-c99.patch diff --git a/cyrus-sasl-2.1.28-fedora-c99.patch b/cyrus-sasl-2.1.28-fedora-c99.patch new file mode 100644 index 0000000..f269f1a --- /dev/null +++ b/cyrus-sasl-2.1.28-fedora-c99.patch @@ -0,0 +1,53 @@ +From 266f0acf7f5e029afbb3e263437039e50cd6c262 Mon Sep 17 00:00:00 2001 +From: Sam James +Date: Wed, 23 Feb 2022 00:45:15 +0000 +Subject: Fix check +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +We're conditionally including based on HAVE_TIME_H in a bunch of places, +but we're not actually checking for time.h, so that's never going to be defined. + +While at it, add in a missing include in the cram plugin. + +This fixes a bunch of implicit declaration warnings: +``` + * cyrus-sasl-2.1.28/lib/saslutil.c:280:3: warning: implicit declaration of function ‘time’ [-Wimplicit-function-declaration] + * cyrus-sasl-2.1.28/lib/saslutil.c:364:41: warning: implicit declaration of function ‘clock’ [-Wimplicit-function-declaration] + * cyrus-sasl-2.1.28/plugins/cram.c:132:7: warning: implicit declaration of function ‘time’ [-Wimplicit-function-declaration] + * cyrus-sasl-2.1.28/lib/saslutil.c:280:3: warning: implicit declaration of function ‘time’ [-Wimplicit-function-declaration] + * cyrus-sasl-2.1.28/lib/saslutil.c:364:41: warning: implicit declaration of function ‘clock’ [-Wimplicit-function-declaration] + * cyrus-sasl-2.1.28/plugins/cram.c:132:7: warning: implicit declaration of function ‘time’ [-Wimplicit-function-declaration] +``` + +Signed-off-by: Sam James + +[Edited to apply to Fedora - DJ] +diff -rup a/configure.ac b/configure.ac +--- a/configure.ac 2023-04-20 00:31:33.578596460 -0400 ++++ b/configure.ac 2023-04-20 01:17:40.877579628 -0400 +@@ -1239,6 +1239,7 @@ AC_CHECK_HEADERS_ONCE([sys/time.h]) + AC_HEADER_DIRENT + AC_HEADER_SYS_WAIT + AC_CHECK_HEADERS(crypt.h des.h dlfcn.h fcntl.h limits.h malloc.h paths.h strings.h sys/file.h sys/time.h syslog.h unistd.h inttypes.h sys/uio.h sys/param.h sysexits.h stdarg.h varargs.h krb5.h) ++AC_CHECK_HEADERS(crypt.h des.h dlfcn.h fcntl.h limits.h malloc.h paths.h strings.h sys/file.h sys/time.h syslog.h time.h unistd.h inttypes.h sys/uio.h sys/param.h sysexits.h stdarg.h varargs.h krb5.h) + AC_CHECK_TYPES([long long, int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t],,,[ + #ifdef HAVE_INTTYPES_H + #include +Only in b: configure.ac.orig +Only in b: configure.ac.rej +diff -rup a/plugins/cram.c b/plugins/cram.c +--- a/plugins/cram.c 2022-02-18 16:50:42.000000000 -0500 ++++ b/plugins/cram.c 2023-04-20 01:20:12.228312652 -0400 +@@ -53,6 +53,10 @@ + #endif + #include + ++#ifdef HAVE_TIME_H ++#include ++#endif ++ + #include + #include + #include diff --git a/cyrus-sasl.spec b/cyrus-sasl.spec index a21b8b6..12461ee 100644 --- a/cyrus-sasl.spec +++ b/cyrus-sasl.spec @@ -46,6 +46,7 @@ Patch500: cyrus-sasl-2.1.27-coverity.patch Patch501: cyrus-sasl-2.1.27-cumulative-digestmd5.patch Patch502: cyrus-sasl-2.1.27-cumulative-ossl3.patch +Patch599: cyrus-sasl-2.1.28-fedora-c99.patch BuildRequires: autoconf, automake, libtool, gdbm-devel, groff BuildRequires: krb5-devel >= 1.2.2, openssl-devel, pam-devel, pkgconfig @@ -176,6 +177,7 @@ the GS2 authentication scheme. %patch500 -p1 -b .coverity %patch501 -p1 -b .digestmd5 %patch502 -p1 -b .ossl3 +%patch599 -p1 -b .c99 %build # reconfigure