From: Marco van Wieringen Date: Wed, 11 Nov 2009 18:21:23 +0000 (+0100) Subject: Disable xattr on NetBSD and FreeBSD in 3.0.x X-Git-Tag: Release-3.0.3b~10 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=b3f4ec968824b27cdeb90b640ceeb8ad5fd3a06b;p=bacula%2Fbacula Disable xattr on NetBSD and FreeBSD in 3.0.x --- diff --git a/bacula/autoconf/configure.in b/bacula/autoconf/configure.in index 6172758557..8a91a312eb 100644 --- a/bacula/autoconf/configure.in +++ b/bacula/autoconf/configure.in @@ -2409,7 +2409,21 @@ fi dnl dnl Check for XATTR support dnl -support_xattr=auto +case $DISTNAME in +freebsd) + # + # FreeBSD gives false positives on the xattr function but seems to have problems compiling the code + # for now disable the checks on FreeBSD, Bacula 3.1.x has proper support for xattr on *BSD + # + support_xattr=no + ;; +netbsd) + support_xattr=no + ;; +*) + support_xattr=auto + ;; +esac AC_ARG_ENABLE(xattr, AC_HELP_STRING([--disable-xattr], [disable xattr support @<:@default=auto@:>@]), [ diff --git a/bacula/src/filed/xattr.c b/bacula/src/filed/xattr.c index 99f9bbb63b..e5ab606ae5 100644 --- a/bacula/src/filed/xattr.c +++ b/bacula/src/filed/xattr.c @@ -32,10 +32,8 @@ * they were saved using a filed on the same platform. * * Currently we support the following OSes: - * - FreeBSD (Extended Attributes) * - Darwin (Extended Attributes) * - Linux (Extended Attributes) - * - NetBSD (Extended Attributes) * - Solaris (Extended Attributes and Extensible Attributes) * * Written by Marco van Wieringen, November MMVIII @@ -119,9 +117,7 @@ static bool send_xattr_stream(JCR *jcr, int stream) * Start with the generic interface used by most OS-es. */ #if defined(HAVE_DARWIN_OS) \ - || defined(HAVE_FREEBSD_OS) \ - || defined(HAVE_LINUX_OS) \ - || defined(HAVE_NETBSD_OS) + || defined(HAVE_LINUX_OS) #ifdef HAVE_SYS_XATTR_H #include @@ -181,7 +177,7 @@ static void xattr_drop_internal_table(xattr_t *xattr_value_list) } /* - * The xattr stream for OSX, FreeBSD, Linux and NetBSD is a serialized stream of bytes + * The xattr stream for OSX, Linux is a serialized stream of bytes * which encodes one or more xattr_t structures. * * The Serialized stream consists of the following elements: @@ -510,24 +506,6 @@ static bool darwin_parse_xattr_stream(JCR *jcr, int stream) return true; /* non-fatal error */ } } -#elif defined(HAVE_FREEBSD_OS) -static bool freebsd_build_xattr_streams(JCR *jcr, FF_PKT *ff_pkt) -{ - return generic_xattr_build_streams(jcr, ff_pkt, STREAM_XATTR_FREEBSD); -} - -static bool freebsd_parse_xattr_stream(JCR *jcr, int stream) -{ - switch (stream) { - case STREAM_XATTR_FREEBSD: - return generic_xattr_parse_streams(jcr); - default: - Jmsg2(jcr, M_WARNING, 0, - _("Can't restore Extended Attributes of %s - incompatible xattr stream encountered - %d\n"), - jcr->last_fname, stream); - return true; /* non-fatal error */ - } -} #elif defined(HAVE_LINUX_OS) static bool linux_build_xattr_streams(JCR *jcr, FF_PKT *ff_pkt) { @@ -546,25 +524,6 @@ static bool linux_parse_xattr_stream(JCR *jcr, int stream) return true; /* non-fatal error */ } } -#elif defined(HAVE_NETBSD_OS) -static bool netbsd_build_xattr_streams(JCR *jcr, FF_PKT *ff_pkt) -{ - return generic_xattr_build_streams(jcr, ff_pkt, STREAM_XATTR_NETBSD); -} - -static bool netbsd_parse_xattr_stream(JCR *jcr, int stream) -{ - switch (stream) { - case STREAM_XATTR_NETBSD: - return generic_xattr_parse_streams(jcr); - default: - Jmsg2(jcr, M_WARNING, 0, - _("Can't restore Extended Attributes of %s - incompatible xattr stream encountered - %d\n"), - jcr->last_fname, stream); - return true; /* non-fatal error */ - } -} -#endif #elif defined(HAVE_SUN_OS) /* * Solaris extended attributes were introduced in Solaris 9