From 713e4b724f4e900b11e93bbb46386106a1b437b5 Mon Sep 17 00:00:00 2001 From: yanying <201250106@smail.nju.edu.cn> Date: Sat, 27 Jul 2024 00:54:38 +0800 Subject: [PATCH] backport fix time.h check (cherry picked from commit 55e8a17bd1146dd7e183b1e5547e7af8117eca32) --- backport-Fix-time.h-check.patch | 60 +++++++++++++++++++++++++++++++++ cyrus-sasl.spec | 6 +++- 2 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 backport-Fix-time.h-check.patch diff --git a/backport-Fix-time.h-check.patch b/backport-Fix-time.h-check.patch new file mode 100644 index 0000000..41a9d1b --- /dev/null +++ b/backport-Fix-time.h-check.patch @@ -0,0 +1,60 @@ +From 783804f41bf410e225b8c221f3e963fc34aee478 Mon Sep 17 00:00:00 2001 +From: Sam James +Date: Wed, 23 Feb 2022 00:45:15 +0000 +Subject: [PATCH] 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 +--- + configure.ac | 2 +- + plugins/cram.c | 4 ++++ + 2 files changed, 5 insertions(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index 2d89fdaa..2e1e697d 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1231,7 +1231,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) + + IPv6_CHECK_SS_FAMILY() + IPv6_CHECK_SA_LEN() +diff --git a/plugins/cram.c b/plugins/cram.c +index d02e9baa..695aaa91 100644 +--- a/plugins/cram.c ++++ b/plugins/cram.c +@@ -53,6 +53,10 @@ + #endif + #include + ++#ifdef HAVE_TIME_H ++#include ++#endif ++ + #include + #include + #include +-- +2.41.0.windows.1 + diff --git a/cyrus-sasl.spec b/cyrus-sasl.spec index 6d15329..87e1663 100644 --- a/cyrus-sasl.spec +++ b/cyrus-sasl.spec @@ -6,7 +6,7 @@ Name: cyrus-sasl Version: 2.1.28 -Release: 2 +Release: 3 Summary: The Cyrus SASL API Implementation License: BSD with advertising @@ -17,6 +17,7 @@ Source2: saslauthd.sysconfig Patch1: backport-Fix-earlier-554-commit-to-use-fetch_errno-instead-of.patch Patch2: backport-sample-Rename-dprint-function.patch +Patch3: backport-Fix-time.h-check.patch BuildRequires: autoconf, automake, libtool, gdbm-devel, groff BuildRequires: krb5-devel >= 1.2.2, openssl-devel, pam-devel, pkgconfig @@ -259,6 +260,9 @@ getent passwd %{username} >/dev/null || useradd -r -g %{username} -d %{homedir} %changelog +* Sat Jul 27 2024 yanying<201250106@smail.nju.edu.cn> - 2.1.28-3 +- backport fix for time.h check + * Thu Feb 1 2024 liyunfei - 2.1.28-2 - backport fix for dprintf -- Gitee