diff --git a/ChangeLog b/ChangeLog index 067c000d..70bb32dd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,9 @@ fwknop-2.5.2 (//2013): - (Radostan Riedel) Added an AppArmor policy that is known to work on Debian and Ubuntu systems. The policy file is available in extras/apparmor. + - [libfko] Nikolay Kolev reported a build issue with Mac OS X Mavericks + where local fwknop copies of strlcat() and strlcpy() were conflicting + with those that already ship with OS X 10.9. Closes #108 on github. - [libfko] (Franck Joncourt) Consolidated FKO context dumping function into lib/fko_util.c. In addition to adding a shared utility function for printing an FKO context, this change also makes the FKO context output diff --git a/configure.ac b/configure.ac index d1ab77f2..98823c85 100644 --- a/configure.ac +++ b/configure.ac @@ -257,7 +257,7 @@ AC_FUNC_MALLOC AC_FUNC_REALLOC AC_FUNC_STAT -AC_CHECK_FUNCS([bzero gettimeofday memmove memset socket strchr strcspn strdup strncasecmp strndup strrchr strspn strnlen stat chmod chown]) +AC_CHECK_FUNCS([bzero gettimeofday memmove memset socket strchr strcspn strdup strncasecmp strndup strrchr strspn strnlen stat chmod chown strlcat strlcpy]) AC_SEARCH_LIBS([socket], [socket]) AC_SEARCH_LIBS([inet_addr], [nsl]) diff --git a/lib/fko_util.h b/lib/fko_util.h index 08849811..e8e0b015 100644 --- a/lib/fko_util.h +++ b/lib/fko_util.h @@ -53,8 +53,13 @@ int zero_buf(char *buf, int len); const char * enc_type_inttostr(const int type); const char * msg_type_inttostr(const int type); +#if !HAVE_STRLCAT size_t strlcat(char *dst, const char *src, size_t siz); +#endif + +#if !HAVE_STRLCPY size_t strlcpy(char *dst, const char *src, size_t siz); +#endif #if defined(WIN32) || !defined(HAVE_STRNDUP) char * strndup( const char * s, size_t len ); diff --git a/lib/strlcat.c b/lib/strlcat.c index ca7b589e..b3a24f7b 100644 --- a/lib/strlcat.c +++ b/lib/strlcat.c @@ -34,6 +34,7 @@ */ #include "fko_common.h" +#if !HAVE_STRLCAT /* * Appends src to string dst of size siz (unlike strncat, siz is the * full size of dst, not space left). At most siz-1 characters @@ -68,5 +69,6 @@ strlcat(char *dst, const char *src, size_t siz) return(dlen + (s - src)); /* count does not include NUL */ } +#endif /***EOF***/ diff --git a/lib/strlcpy.c b/lib/strlcpy.c index 6e56ca6e..526898f1 100644 --- a/lib/strlcpy.c +++ b/lib/strlcpy.c @@ -34,6 +34,7 @@ */ #include "fko_common.h" +#if !HAVE_STRLCPY /* * Copy src to string dst of size siz. At most siz-1 characters * will be copied. Always NUL terminates (unless siz == 0). @@ -64,5 +65,6 @@ strlcpy(char *dst, const char *src, size_t siz) return(s - src - 1); /* count does not include NUL */ } +#endif /***EOF***/