I just had another look at this today with fresh eyes and I see you've already
got a static replacement of strndup for Solaris, so I've included a patch which
uses the same function on macOS 10.6.8 or lower. It relies on the appropriate
(-mmacosx-version-min=10.6) setting on the configure phase, but the chances are
if anyone's compiling with 10.6 support, they probably ain't compiling on 10.6
so it's likely being supplied already.
diff -Naurw clamav-0.99.3-beta1/clamd/localserver.c
clamav-0.99.3-beta1_patched/clamd/localserver.c
--- clamav-0.99.3-beta1/clamd/localserver.c 2017-07-31 19:34:32.000000000
+0100
+++ clamav-0.99.3-beta1_patched/clamd/localserver.c 2017-08-14
14:24:08.000000000 +0100
@@ -25,7 +25,7 @@
#include <stdio.h>
#include <string.h>
-#if defined(C_SOLARIS)
+#if defined(C_SOLARIS) ||
(defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) &&
(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ <= 1068))
size_t strnlen(const char *s, size_t n) __attribute__((weak));
size_t strnlen(const char *s, size_t n)
{
Hope that's useful.
Mark
> On 13 Aug 2017, at 10:25 pm, Mark Allan <[email protected]> wrote:
>
> Hi all,
>
> Another issue with 0.99.3 beta 1.
>
> The clamd process crashes on macOS 10.6.8 because it can't find the strndup
> symbol. There are a couple of references to strndup in the source for clamd
> and libclamav - should these be changed to cli_strndup or am I better to
> include a static replacement function of strndup in the appropriate files
> that would only be used on 10.6 or earlier?
>
> Thanks
> Mark
>
_______________________________________________
clamav-users mailing list
[email protected]
http://lists.clamav.net/cgi-bin/mailman/listinfo/clamav-users
Help us build a comprehensive ClamAV guide:
https://github.com/vrtadmin/clamav-faq
http://www.clamav.net/contact.html#ml