diff -Nru opendkim-2.7.4/configure.ac opendkim-2.7.4/configure.ac --- opendkim-2.7.4/configure.ac 2013-01-18 06:47:47.000000000 +0000 +++ opendkim-2.7.4/configure.ac 2013-01-18 06:47:47.000000000 +0000 @@ -182,6 +182,9 @@ AC_CHECK_FUNCS([dup2 endpwent getcwd gethostname gethostbyname getaddrinfo gethostbyname2 gettimeofday isascii memchr memmove memset regcomp select socket strcasecmp strchr strdup strerror strncasecmp strrchr strstr strtol strtoul strtoull]) +bsdstrl_h_found="no" +AC_CHECK_HEADERS([bsd/string.h], [bsdstrl_h_found="yes"]) + strl_found="no" libstrl_found="no" strl_h_found="no" @@ -218,11 +221,11 @@ saved_LIBS="$LIBS" LIBS="" AC_SEARCH_LIBS([strlcat], - [strl], + [bsd strl], [libstrl_found="yes"], [strl_found="no"]) AC_SEARCH_LIBS([strlcpy], - [strl], + [bsd strl], [libstrl_found="yes"], [strl_found="no"]) STRL_LIBS="$LIBS" @@ -236,13 +239,18 @@ fi # we need to include if: # (a) strlcat and strlcpy weren't found, since we'll be rolling our own; OR -# (b) an installed strl.h was found -if test x"$strl_h_found" = x"yes" -o \( x"$strl_found" = x"no" -a x"$libstrl_found" = x"no" \) +# (b) an installed strl.h was found and no installed bsd/string.h was found +if test x"$strl_h_found" = x"yes" -o \( x"$strl_found" = x"no" -a x"$libstrl_found" = x"no" \) -a x"$bsdstrl_h_found" = x"no" then AC_DEFINE([USE_STRL_H], 1, [Define to 1 if you need to include to get the `strlcat()' and `strlcpy()' functions.]) fi +if test x"$bsdstrl_h_found" = x"yes" +then + AC_DEFINE([USE_BSD_H], 1, + [Define to 1 if you need to include to get the `strlcat()' and `strlcpy()' functions.]) +fi # # Checks for structure members # diff -Nru opendkim-2.7.4/libopendkim/dkim-cache.c opendkim-2.7.4/libopendkim/dkim-cache.c --- opendkim-2.7.4/libopendkim/dkim-cache.c 2012-11-30 01:32:17.000000000 +0000 +++ opendkim-2.7.4/libopendkim/dkim-cache.c 2013-01-18 06:47:47.000000000 +0000 @@ -27,6 +27,11 @@ #include "dkim-internal.h" #include "dkim-cache.h" +/* libbsd if found */ +#ifdef USE_BSD_H +# include +#endif /* USE_BSD_H */ + /* libstrl if needed */ #ifdef USE_STRL_H # include diff -Nru opendkim-2.7.4/libopendkim/dkim-canon.c opendkim-2.7.4/libopendkim/dkim-canon.c --- opendkim-2.7.4/libopendkim/dkim-canon.c 2012-11-30 01:32:17.000000000 +0000 +++ opendkim-2.7.4/libopendkim/dkim-canon.c 2013-01-18 06:47:47.000000000 +0000 @@ -45,6 +45,11 @@ #include "dkim-util.h" #include "util.h" +/* libbsd if found */ +#ifdef USE_BSD_H +# include +#endif /* USE_BSD_H */ + /* libstrl if needed */ #ifdef USE_STRL_H # include diff -Nru opendkim-2.7.4/libopendkim/dkim-keys.c opendkim-2.7.4/libopendkim/dkim-keys.c --- opendkim-2.7.4/libopendkim/dkim-keys.c 2012-11-30 01:32:17.000000000 +0000 +++ opendkim-2.7.4/libopendkim/dkim-keys.c 2013-01-18 06:47:47.000000000 +0000 @@ -29,6 +29,11 @@ #include "dkim-test.h" #include "util.h" +/* libbsd if found */ +#ifdef USE_BSD_H +# include +#endif /* USE_BSD_H */ + /* libstrl if needed */ #ifdef USE_STRL_H # include diff -Nru opendkim-2.7.4/libopendkim/dkim-policy.c opendkim-2.7.4/libopendkim/dkim-policy.c --- opendkim-2.7.4/libopendkim/dkim-policy.c 2012-11-30 01:32:17.000000000 +0000 +++ opendkim-2.7.4/libopendkim/dkim-policy.c 2013-01-18 06:47:47.000000000 +0000 @@ -34,6 +34,11 @@ #include "dkim-test.h" #include "util.h" +/* libbsd if found */ +#ifdef USE_BSD_H +# include +#endif /* USE_BSD_H */ + /* libstrl if needed */ #ifdef USE_STRL_H # include diff -Nru opendkim-2.7.4/libopendkim/dkim-test.c opendkim-2.7.4/libopendkim/dkim-test.c --- opendkim-2.7.4/libopendkim/dkim-test.c 2012-11-30 01:32:17.000000000 +0000 +++ opendkim-2.7.4/libopendkim/dkim-test.c 2013-01-18 06:47:47.000000000 +0000 @@ -36,6 +36,11 @@ #include "dkim-util.h" #include "dkim-test.h" +/* libbsd if found */ +#ifdef USE_BSD_H +# include +#endif /* USE_BSD_H */ + /* libstrl if needed */ #ifdef USE_STRL_H # include diff -Nru opendkim-2.7.4/libopendkim/dkim.c opendkim-2.7.4/libopendkim/dkim.c --- opendkim-2.7.4/libopendkim/dkim.c 2012-11-30 01:32:17.000000000 +0000 +++ opendkim-2.7.4/libopendkim/dkim.c 2013-01-18 06:47:47.000000000 +0000 @@ -92,6 +92,11 @@ #include "util.h" #include "base64.h" +/* libbsd if found */ +#ifdef USE_BSD_H +# include +#endif /* USE_BSD_H */ + /* libstrl if needed */ #ifdef USE_STRL_H # include diff -Nru opendkim-2.7.4/libopendkim/tests/t-test122.c opendkim-2.7.4/libopendkim/tests/t-test122.c --- opendkim-2.7.4/libopendkim/tests/t-test122.c 2012-11-30 01:32:17.000000000 +0000 +++ opendkim-2.7.4/libopendkim/tests/t-test122.c 2013-01-18 06:47:47.000000000 +0000 @@ -22,6 +22,11 @@ #include "../dkim.h" #include "t-testdata.h" +/* libbsd if found */ +#ifdef USE_BSD_H +# include +#endif /* USE_BSD_H */ + /* libstrl if needed */ #ifdef USE_STRL_H # include diff -Nru opendkim-2.7.4/libopendkim/tests/t-test123.c opendkim-2.7.4/libopendkim/tests/t-test123.c --- opendkim-2.7.4/libopendkim/tests/t-test123.c 2012-11-30 01:32:17.000000000 +0000 +++ opendkim-2.7.4/libopendkim/tests/t-test123.c 2013-01-18 06:47:47.000000000 +0000 @@ -22,6 +22,11 @@ #include "../dkim.h" #include "t-testdata.h" +/* libbsd if found */ +#ifdef USE_BSD_H +# include +#endif /* USE_BSD_H */ + /* libstrl if needed */ #ifdef USE_STRL_H # include diff -Nru opendkim-2.7.4/libopendkim/tests/t-test127.c opendkim-2.7.4/libopendkim/tests/t-test127.c --- opendkim-2.7.4/libopendkim/tests/t-test127.c 2012-11-30 01:32:17.000000000 +0000 +++ opendkim-2.7.4/libopendkim/tests/t-test127.c 2013-01-18 06:47:47.000000000 +0000 @@ -22,6 +22,11 @@ #include "../dkim.h" #include "t-testdata.h" +/* libbsd if found */ +#ifdef USE_BSD_H +# include +#endif /* USE_BSD_H */ + /* libstrl if needed */ #ifdef USE_STRL_H # include diff -Nru opendkim-2.7.4/libopendkim/tests/t-test131.c opendkim-2.7.4/libopendkim/tests/t-test131.c --- opendkim-2.7.4/libopendkim/tests/t-test131.c 2012-11-30 01:32:17.000000000 +0000 +++ opendkim-2.7.4/libopendkim/tests/t-test131.c 2013-01-18 06:47:47.000000000 +0000 @@ -23,6 +23,11 @@ #include "../dkim.h" #include "t-testdata.h" +/* libbsd if found */ +#ifdef USE_BSD_H +# include +#endif /* USE_BSD_H */ + /* libstrl if needed */ #ifdef USE_STRL_H # include diff -Nru opendkim-2.7.4/libopendkim/tests/t-test136.c opendkim-2.7.4/libopendkim/tests/t-test136.c --- opendkim-2.7.4/libopendkim/tests/t-test136.c 2012-11-30 01:32:17.000000000 +0000 +++ opendkim-2.7.4/libopendkim/tests/t-test136.c 2013-01-18 06:47:47.000000000 +0000 @@ -22,6 +22,11 @@ #include "../dkim.h" #include "t-testdata.h" +/* libbsd if found */ +#ifdef USE_BSD_H +# include +#endif /* USE_BSD_H */ + /* libstrl if needed */ #ifdef USE_STRL_H # include diff -Nru opendkim-2.7.4/libopendkim/tests/t-test142.c opendkim-2.7.4/libopendkim/tests/t-test142.c --- opendkim-2.7.4/libopendkim/tests/t-test142.c 2012-11-30 01:32:17.000000000 +0000 +++ opendkim-2.7.4/libopendkim/tests/t-test142.c 2013-01-18 06:47:47.000000000 +0000 @@ -22,6 +22,11 @@ #include "../dkim.h" #include "t-testdata.h" +/* libbsd if found */ +#ifdef USE_BSD_H +# include +#endif /* USE_BSD_H */ + /* libstrl if needed */ #ifdef USE_STRL_H # include diff -Nru opendkim-2.7.4/libopendkim/tests/t-test42.c opendkim-2.7.4/libopendkim/tests/t-test42.c --- opendkim-2.7.4/libopendkim/tests/t-test42.c 2012-11-30 01:32:17.000000000 +0000 +++ opendkim-2.7.4/libopendkim/tests/t-test42.c 2013-01-18 06:47:47.000000000 +0000 @@ -26,6 +26,11 @@ #include "../dkim.h" #include "t-testdata.h" +/* libbsd if found */ +#ifdef USE_BSD_H +# include +#endif /* USE_BSD_H */ + /* libstrl if needed */ #ifdef USE_STRL_H # include diff -Nru opendkim-2.7.4/libopendkim/tests/t-test55.c opendkim-2.7.4/libopendkim/tests/t-test55.c --- opendkim-2.7.4/libopendkim/tests/t-test55.c 2012-11-30 01:32:17.000000000 +0000 +++ opendkim-2.7.4/libopendkim/tests/t-test55.c 2013-01-18 06:47:47.000000000 +0000 @@ -22,6 +22,11 @@ #include "../dkim.h" #include "t-testdata.h" +/* libbsd if found */ +#ifdef USE_BSD_H +# include +#endif /* USE_BSD_H */ + /* libstrl if needed */ #ifdef USE_STRL_H # include diff -Nru opendkim-2.7.4/libopendkim/tests/t-test56.c opendkim-2.7.4/libopendkim/tests/t-test56.c --- opendkim-2.7.4/libopendkim/tests/t-test56.c 2012-11-30 01:32:17.000000000 +0000 +++ opendkim-2.7.4/libopendkim/tests/t-test56.c 2013-01-18 06:47:47.000000000 +0000 @@ -22,6 +22,11 @@ #include "../dkim.h" #include "t-testdata.h" +/* libbsd if found */ +#ifdef USE_BSD_H +# include +#endif /* USE_BSD_H */ + /* libstrl if needed */ #ifdef USE_STRL_H # include diff -Nru opendkim-2.7.4/libopendkim/tests/t-test57.c opendkim-2.7.4/libopendkim/tests/t-test57.c --- opendkim-2.7.4/libopendkim/tests/t-test57.c 2012-11-30 01:32:17.000000000 +0000 +++ opendkim-2.7.4/libopendkim/tests/t-test57.c 2013-01-18 06:47:47.000000000 +0000 @@ -24,6 +24,11 @@ #include "../dkim.h" #include "t-testdata.h" +/* libbsd if found */ +#ifdef USE_BSD_H +# include +#endif /* USE_BSD_H */ + /* libstrl if needed */ #ifdef USE_STRL_H # include diff -Nru opendkim-2.7.4/libopendkim/tests/t-test73.c opendkim-2.7.4/libopendkim/tests/t-test73.c --- opendkim-2.7.4/libopendkim/tests/t-test73.c 2012-11-30 01:32:17.000000000 +0000 +++ opendkim-2.7.4/libopendkim/tests/t-test73.c 2013-01-18 06:47:47.000000000 +0000 @@ -27,6 +27,11 @@ #include "../dkim.h" #include "t-testdata.h" +/* libbsd if found */ +#ifdef USE_BSD_H +# include +#endif /* USE_BSD_H */ + /* libstrl if needed */ #ifdef USE_STRL_H # include diff -Nru opendkim-2.7.4/libopendkim/tests/t-test84.c opendkim-2.7.4/libopendkim/tests/t-test84.c --- opendkim-2.7.4/libopendkim/tests/t-test84.c 2012-11-30 01:32:17.000000000 +0000 +++ opendkim-2.7.4/libopendkim/tests/t-test84.c 2013-01-18 06:47:47.000000000 +0000 @@ -26,6 +26,11 @@ #include "../dkim.h" #include "t-testdata.h" +/* libbsd if found */ +#ifdef USE_BSD_H +# include +#endif /* USE_BSD_H */ + /* libstrl if needed */ #ifdef USE_STRL_H # include diff -Nru opendkim-2.7.4/libopendkim/tests/t-test86.c opendkim-2.7.4/libopendkim/tests/t-test86.c --- opendkim-2.7.4/libopendkim/tests/t-test86.c 2012-11-30 01:32:17.000000000 +0000 +++ opendkim-2.7.4/libopendkim/tests/t-test86.c 2013-01-18 06:47:47.000000000 +0000 @@ -26,6 +26,11 @@ #include "../dkim.h" #include "t-testdata.h" +/* libbsd if found */ +#ifdef USE_BSD_H +# include +#endif /* USE_BSD_H */ + /* libstrl if needed */ #ifdef USE_STRL_H # include diff -Nru opendkim-2.7.4/libopendkim/tests/t-test88.c opendkim-2.7.4/libopendkim/tests/t-test88.c --- opendkim-2.7.4/libopendkim/tests/t-test88.c 2012-11-30 01:32:17.000000000 +0000 +++ opendkim-2.7.4/libopendkim/tests/t-test88.c 2013-01-18 06:47:47.000000000 +0000 @@ -22,6 +22,11 @@ #include "../dkim.h" #include "t-testdata.h" +/* libbsd if found */ +#ifdef USE_BSD_H +# include +#endif /* USE_BSD_H */ + /* libstrl if needed */ #ifdef USE_STRL_H # include diff -Nru opendkim-2.7.4/libopendkim/util.c opendkim-2.7.4/libopendkim/util.c --- opendkim-2.7.4/libopendkim/util.c 2012-11-30 01:32:17.000000000 +0000 +++ opendkim-2.7.4/libopendkim/util.c 2013-01-18 06:47:47.000000000 +0000 @@ -27,6 +27,11 @@ #include "dkim-internal.h" #include "util.h" +/* libbsd if found */ +#ifdef USE_BSD_H +# include +#endif /* USE_BSD_H */ + /* libstrl if needed */ #ifdef USE_STRL_H # include diff -Nru opendkim-2.7.4/miltertest/miltertest.c opendkim-2.7.4/miltertest/miltertest.c --- opendkim-2.7.4/miltertest/miltertest.c 2013-01-18 06:47:47.000000000 +0000 +++ opendkim-2.7.4/miltertest/miltertest.c 2013-01-18 06:47:47.000000000 +0000 @@ -38,6 +38,11 @@ /* libopendkim includes */ #include +/* libbsd if found */ +#ifdef USE_BSD_H +# include +#endif /* USE_BSD_H */ + /* libstrl if needed */ #ifdef USE_STRL_H # include diff -Nru opendkim-2.7.4/opendkim/config.c opendkim-2.7.4/opendkim/config.c --- opendkim-2.7.4/opendkim/config.c 2013-01-07 01:07:30.000000000 +0000 +++ opendkim-2.7.4/opendkim/config.c 2013-01-18 06:47:47.000000000 +0000 @@ -23,6 +23,11 @@ /* libopendkim includes */ #include +/* libbsd if found */ +#ifdef USE_BSD_H +# include +#endif /* USE_BSD_H */ + /* libstrl if needed */ #ifdef USE_STRL_H # include diff -Nru opendkim-2.7.4/opendkim/flowrate.c opendkim-2.7.4/opendkim/flowrate.c --- opendkim-2.7.4/opendkim/flowrate.c 2012-11-30 01:32:17.000000000 +0000 +++ opendkim-2.7.4/opendkim/flowrate.c 2013-01-18 06:47:47.000000000 +0000 @@ -16,6 +16,11 @@ #include #include +/* libbsd if found */ +#ifdef USE_BSD_H +# include +#endif /* USE_BSD_H */ + /* libstrl if needed */ #ifdef USE_STRL_H # include diff -Nru opendkim-2.7.4/opendkim/opendkim-ar.c opendkim-2.7.4/opendkim/opendkim-ar.c --- opendkim-2.7.4/opendkim/opendkim-ar.c 2013-01-07 01:07:30.000000000 +0000 +++ opendkim-2.7.4/opendkim/opendkim-ar.c 2013-01-18 06:47:47.000000000 +0000 @@ -22,6 +22,11 @@ # include #endif /* ARTEST */ +/* libbsd if found */ +#ifdef USE_BSD_H +# include +#endif /* USE_BSD_H */ + /* libstrl if needed */ #ifdef USE_STRL_H # include diff -Nru opendkim-2.7.4/opendkim/opendkim-db.c opendkim-2.7.4/opendkim/opendkim-db.c --- opendkim-2.7.4/opendkim/opendkim-db.c 2012-11-30 01:32:17.000000000 +0000 +++ opendkim-2.7.4/opendkim/opendkim-db.c 2013-01-18 06:47:47.000000000 +0000 @@ -37,6 +37,11 @@ /* libopendkim includes */ #include +/* libbsd if found */ +#ifdef USE_BSD_H +# include +#endif /* USE_BSD_H */ + /* libstrl if needed */ #ifdef USE_STRL_H # include diff -Nru opendkim-2.7.4/opendkim/opendkim-spam.c opendkim-2.7.4/opendkim/opendkim-spam.c --- opendkim-2.7.4/opendkim/opendkim-spam.c 2012-11-30 01:32:17.000000000 +0000 +++ opendkim-2.7.4/opendkim/opendkim-spam.c 2013-01-18 06:47:47.000000000 +0000 @@ -24,6 +24,11 @@ # include #endif /* USE_ODBX */ +/* libbsd if found */ +#ifdef USE_BSD_H +# include +#endif /* USE_BSD_H */ + /* libstrl if needed */ #ifdef USE_STRL_H # include diff -Nru opendkim-2.7.4/opendkim/opendkim-testkey.c opendkim-2.7.4/opendkim/opendkim-testkey.c --- opendkim-2.7.4/opendkim/opendkim-testkey.c 2012-11-30 01:32:17.000000000 +0000 +++ opendkim-2.7.4/opendkim/opendkim-testkey.c 2013-01-18 06:47:47.000000000 +0000 @@ -39,6 +39,11 @@ #include #include +/* libbsd if found */ +#ifdef USE_BSD_H +# include +#endif /* USE_BSD_H */ + /* libstrl if needed */ #ifdef USE_STRL_H # include diff -Nru opendkim-2.7.4/opendkim/opendkim.c opendkim-2.7.4/opendkim/opendkim.c --- opendkim-2.7.4/opendkim/opendkim.c 2013-01-07 01:07:30.000000000 +0000 +++ opendkim-2.7.4/opendkim/opendkim.c 2013-01-18 06:47:47.000000000 +0000 @@ -98,6 +98,11 @@ # include "vbr.h" #endif /* _FFR_VBR */ +/* libbsd if found */ +#ifdef USE_BSD_H +# include +#endif /* USE_BSD_H */ + /* libstrl if needed */ #ifdef USE_STRL_H # include diff -Nru opendkim-2.7.4/opendkim/reputation.c opendkim-2.7.4/opendkim/reputation.c --- opendkim-2.7.4/opendkim/reputation.c 2012-11-30 01:32:17.000000000 +0000 +++ opendkim-2.7.4/opendkim/reputation.c 2013-01-18 06:47:47.000000000 +0000 @@ -22,6 +22,11 @@ /* libopendkim includes */ #include +/* libbsd if found */ +#ifdef USE_BSD_H +# include +#endif /* USE_BSD_H */ + /* libstrl if needed */ #ifdef USE_STRL_H # include diff -Nru opendkim-2.7.4/opendkim/stats.c opendkim-2.7.4/opendkim/stats.c --- opendkim-2.7.4/opendkim/stats.c 2012-11-30 01:32:17.000000000 +0000 +++ opendkim-2.7.4/opendkim/stats.c 2013-01-18 06:47:47.000000000 +0000 @@ -41,6 +41,11 @@ /* libopendkim includes */ #include +/* libbsd if found */ +#ifdef USE_BSD_H +# include +#endif /* USE_BSD_H */ + /* libstrl if needed */ #ifdef USE_STRL_H # include diff -Nru opendkim-2.7.4/opendkim/test.c opendkim-2.7.4/opendkim/test.c --- opendkim-2.7.4/opendkim/test.c 2012-11-30 01:32:17.000000000 +0000 +++ opendkim-2.7.4/opendkim/test.c 2013-01-18 06:47:47.000000000 +0000 @@ -22,6 +22,11 @@ #include "build-config.h" #include +/* libbsd if found */ +#ifdef USE_BSD_H +# include +#endif /* USE_BSD_H */ + /* libstrl if needed */ #ifdef USE_STRL_H # include diff -Nru opendkim-2.7.4/opendkim/util.c opendkim-2.7.4/opendkim/util.c --- opendkim-2.7.4/opendkim/util.c 2012-11-30 01:32:17.000000000 +0000 +++ opendkim-2.7.4/opendkim/util.c 2013-01-18 06:47:47.000000000 +0000 @@ -47,6 +47,11 @@ # endif /* SOLARIS <= 20600 */ #endif /* SOLARIS */ +/* libbsd if found */ +#ifdef USE_BSD_H +# include +#endif /* USE_BSD_H */ + /* libstrl if needed */ #ifdef USE_STRL_H # include diff -Nru opendkim-2.7.4/stats/opendkim-importstats.c opendkim-2.7.4/stats/opendkim-importstats.c --- opendkim-2.7.4/stats/opendkim-importstats.c 2012-11-30 01:32:17.000000000 +0000 +++ opendkim-2.7.4/stats/opendkim-importstats.c 2013-01-18 06:47:47.000000000 +0000 @@ -23,6 +23,11 @@ /* OpenDKIM includes */ #include "stats.h" +/* libbsd if found */ +#ifdef USE_BSD_H +# include +#endif /* USE_BSD_H */ + /* libstrl if needed */ #ifdef USE_STRL_H # include