|
1 | | -From 266f0acf7f5e029afbb3e263437039e50cd6c262 Mon Sep 17 00:00:00 2001 |
2 | | -From: Sam James <> |
3 | | -Date: Wed, 23 Feb 2022 00:45:15 +0000 |
4 | | -Subject: [PATCH] Fix <time.h> check |
5 | | -MIME-Version: 1.0 |
6 | | -Content-Type: text/plain; charset=UTF-8 |
7 | | -Content-Transfer-Encoding: 8bit |
| 1 | +Backport https://github.com/cyrusimap/cyrus-sasl/pull/709 |
8 | 2 |
|
9 | | -We're conditionally including based on HAVE_TIME_H in a bunch of places, |
10 | | -but we're not actually checking for time.h, so that's never going to be defined. |
11 | | - |
12 | | -While at it, add in a missing include in the cram plugin. |
13 | | - |
14 | | -This fixes a bunch of implicit declaration warnings: |
15 | | -``` |
16 | | - * cyrus-sasl-2.1.28/lib/saslutil.c:280:3: warning: implicit declaration of function ‘time’ [-Wimplicit-function-declaration] |
17 | | - * cyrus-sasl-2.1.28/lib/saslutil.c:364:41: warning: implicit declaration of function ‘clock’ [-Wimplicit-function-declaration] |
18 | | - * cyrus-sasl-2.1.28/plugins/cram.c:132:7: warning: implicit declaration of function ‘time’ [-Wimplicit-function-declaration] |
19 | | - * cyrus-sasl-2.1.28/lib/saslutil.c:280:3: warning: implicit declaration of function ‘time’ [-Wimplicit-function-declaration] |
20 | | - * cyrus-sasl-2.1.28/lib/saslutil.c:364:41: warning: implicit declaration of function ‘clock’ [-Wimplicit-function-declaration] |
21 | | - * cyrus-sasl-2.1.28/plugins/cram.c:132:7: warning: implicit declaration of function ‘time’ [-Wimplicit-function-declaration] |
22 | | -``` |
23 | | - |
24 | | -https://github.com/cyrusimap/cyrus-sasl/commit/266f0acf7f5e029afbb3e263437039e50cd6c262 |
25 | | - |
26 | | ---- a/lib/saslutil.c |
27 | | -+++ b/lib/saslutil.c |
28 | | -@@ -59,9 +59,7 @@ |
29 | | - #ifdef HAVE_UNISTD_H |
30 | | - #include <unistd.h> |
31 | | - #endif |
32 | | --#ifdef HAVE_TIME_H |
33 | | - #include <time.h> |
34 | | --#endif |
35 | | - #include "saslint.h" |
36 | | - #include <saslutil.h> |
| 3 | +diff --git a/configure b/configure |
| 4 | +index 71dff1b..96e41c5 100755 |
| 5 | +--- a/configure |
| 6 | ++++ b/configure |
| 7 | +@@ -20765,7 +20765,7 @@ $as_echo "#define HAVE_SYS_WAIT_H 1" >>confdefs.h |
| 8 | + |
| 9 | + fi |
| 10 | + |
| 11 | +-for ac_header in 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 |
| 12 | ++for ac_header in 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 |
| 13 | + do : |
| 14 | + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` |
| 15 | + ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" |
37 | 16 |
|
| 17 | +diff --git a/plugins/cram.c b/plugins/cram.c |
| 18 | +index d02e9baa..695aaa91 100644 |
38 | 19 | --- a/plugins/cram.c |
39 | 20 | +++ b/plugins/cram.c |
40 | | -@@ -53,6 +53,7 @@ |
| 21 | +@@ -53,6 +53,10 @@ |
41 | 22 | #endif |
42 | 23 | #include <fcntl.h> |
43 | 24 |
|
| 25 | ++#ifdef HAVE_TIME_H |
44 | 26 | +#include <time.h> |
| 27 | ++#endif |
| 28 | ++ |
45 | 29 | #include <sasl.h> |
46 | 30 | #include <saslplug.h> |
47 | 31 | #include <saslutil.h> |
| 32 | + |
| 33 | +index 8f2f1be..28f9c95 100644 |
| 34 | +--- a/config.h.in |
| 35 | ++++ b/config.h.in |
| 36 | +@@ -304,6 +304,9 @@ |
| 37 | + /* Define to 1 if you have the <string.h> header file. */ |
| 38 | + #undef HAVE_STRING_H |
| 39 | + |
| 40 | ++/* Define to 1 if you have the <time.h> header file. */ |
| 41 | ++#undef HAVE_TIME_H |
| 42 | ++ |
| 43 | + /* Define to 1 if you have the `strlcat' function. */ |
| 44 | + #undef HAVE_STRLCAT |
| 45 | + |
0 commit comments