Bug#763693: dnsmasq: FTBFS[kfreebsd]: missing strlcpy
Package: dnsmasq
Version: 2.72-1
Severity: serious
Tags: patch
User: debian-bsd@lists.debian.org
Usertags: kfreebsd
Hi,
dnsmasq FTBFS on kfreebsd, because it builds some code to use FreeBSD
PF, which also uses strlcpy, which is only found in FreeBSD libc.
For Debian GNU/kFreeBSD it is possible to get this function from libbsd;
patch attached!
Thanks.
-- System Information:
Debian Release: jessie/sid
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'stable')
Architecture: kfreebsd-amd64 (x86_64)
Kernel: kFreeBSD 9.0-2-amd64-xenhvm-ipsec
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
diff -Nru dnsmasq-2.72.orig/debian/control dnsmasq-2.72/debian/control
--- dnsmasq-2.72.orig/debian/control 2014-10-01 21:57:13.000000000 +0100
+++ dnsmasq-2.72/debian/control 2014-10-01 22:07:34.489734195 +0100
@@ -3,7 +3,7 @@
Priority: optional
Build-depends: gettext, libnetfilter-conntrack-dev [linux-any],
libidn11-dev, libdbus-1-dev (>=0.61), libgmp-dev,
- nettle-dev (>=2.4-3)
+ nettle-dev (>=2.4-3), libbsd-dev [!linux-any]
Maintainer: Simon Kelley <simon@thekelleys.org.uk>
Standards-Version: 3.9.5
diff -Nru dnsmasq-2.72.orig/debian/rules dnsmasq-2.72/debian/rules
--- dnsmasq-2.72.orig/debian/rules 2014-10-01 21:57:13.000000000 +0100
+++ dnsmasq-2.72/debian/rules 2014-10-01 22:05:34.282734624 +0100
@@ -83,6 +83,11 @@
DEB_COPTS += -DHAVE_DNSSEC
endif
+ifneq ($(DEB_BUILD_ARCH_OS),linux)
+ # For strlcpy
+ LDFLAGS += -lbsd
+endif
+
clean:
$(checkdir)
rm -rf debian/daemon debian/base debian/utils debian/*~ debian/files debian/substvars debian/utils-substvars
diff -Nru dnsmasq-2.72.orig/src/tables.c dnsmasq-2.72/src/tables.c
--- dnsmasq-2.72.orig/src/tables.c 2014-10-01 22:05:38.761734000 +0100
+++ dnsmasq-2.72/src/tables.c 2014-10-01 22:06:03.831679913 +0100
@@ -19,6 +19,9 @@
#include "dnsmasq.h"
#if defined(HAVE_IPSET) && defined(HAVE_BSD_NETWORK)
+#ifndef __FreeBSD__
+#include <bsd/string.h>
+#endif
#include <sys/types.h>
#include <sys/ioctl.h>
Reply to: