[PATCH] Enhance vfs_fruit manpage and testparm checks for vfs_fruit stuff
Jeremy Allison
jra at samba.org
Wed Mar 9 16:47:26 UTC 2016
On Wed, Mar 09, 2016 at 05:19:05PM +0100, Ralph Boehme wrote:
> Hi!
>
> Attached is a patchset that adds some important information to the
> vfs_fruit manpage and adds checks to testparm that cover this.
>
> Please review & push if ok. Thanks!
LGTM. Pushed.
Minor complain. I *hate* new static's, although I can
see why you used them :-).
Lemme think if there's a better way (can't see one
right now though...).
> --
> SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
> phone: +49-551-370000-0, fax: +49-551-370000-9
> AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
> http://www.sernet.de,mailto:kontakt@sernet.de
> From d8ea6cbbb9ba1e462007b4c8aecdcbdcf7ef540d Mon Sep 17 00:00:00 2001
> From: Ralph Boehme <slow at samba.org>
> Date: Wed, 9 Mar 2016 13:53:09 +0100
> Subject: [PATCH 1/2] testparm: vfs_fruit checks
>
> - vfs_fruit requires "ea support = yes"
>
> - OS X clients negotiate AAPL on the first tcon, so mixing shares with
> and without fruit will globally disable AAPL if the first tcon is
> without fruit
>
> Signed-off-by: Ralph Boehme <slow at samba.org>
> ---
> source3/utils/testparm.c | 24 ++++++++++++++++++++++++
> 1 file changed, 24 insertions(+)
>
> diff --git a/source3/utils/testparm.c b/source3/utils/testparm.c
> index 5912d18..e1d66ce 100644
> --- a/source3/utils/testparm.c
> +++ b/source3/utils/testparm.c
> @@ -345,7 +345,11 @@ static void do_per_share_checks(int s)
> {
> const char **deny_list = lp_hosts_deny(s);
> const char **allow_list = lp_hosts_allow(s);
> + const char **vfs_objects = NULL;
> int i;
> + static bool uses_fruit;
> + static bool doesnt_use_fruit;
> + static bool fruit_mix_warned;
>
> if(deny_list) {
> for (i=0; deny_list[i]; i++) {
> @@ -426,6 +430,26 @@ static void do_per_share_checks(int s)
> "parameter is ignored when using CUPS libraries.\n\n",
> lp_servicename(talloc_tos(), s));
> }
> +
> + vfs_objects = lp_vfs_objects(s);
> + if (vfs_objects && str_list_check(vfs_objects, "fruit")) {
> + uses_fruit = true;
> + if (!lp_ea_support(s) && !lp_ea_support(-1)) {
> + fprintf(stderr,
> + "ERROR: Service \"%s\" uses vfs_fruit, but "
> + "that requires \"ea support = yes\".\n\n",
> + lp_servicename(talloc_tos(), s));
> + }
> + } else {
> + doesnt_use_fruit = true;
> + }
> +
> + if (uses_fruit && doesnt_use_fruit && !fruit_mix_warned) {
> + fruit_mix_warned = true;
> + fprintf(stderr,
> + "WARNING: some services use vfs_fruit, others don't. Mounting them "
> + "in conjunction on OS X clients results in undefined behaviour.\n\n");
> + }
> }
>
> int main(int argc, const char *argv[])
> --
> 2.5.0
>
>
> From e0060d5dbfda4037f023c483a9d3acaea81640f6 Mon Sep 17 00:00:00 2001
> From: Ralph Boehme <slow at samba.org>
> Date: Wed, 9 Mar 2016 14:01:05 +0100
> Subject: [PATCH 2/2] docs: update vfs_fruit manpage
>
> Add documentation that ea support = yes is required and explain why all
> shares for OS X clients should use fruit if one uses it.
>
> Signed-off-by: Ralph Boehme <slow at samba.org>
> ---
> docs-xml/manpages/vfs_fruit.8.xml | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/docs-xml/manpages/vfs_fruit.8.xml b/docs-xml/manpages/vfs_fruit.8.xml
> index 2ac5db7..36d137e 100644
> --- a/docs-xml/manpages/vfs_fruit.8.xml
> +++ b/docs-xml/manpages/vfs_fruit.8.xml
> @@ -45,6 +45,14 @@
> <command>vfs_streams_xattr</command> which must be loaded
> together with <command>vfs_fruit</command>.</para>
>
> + <para>vfs_fruit requires "ea support = yes".</para>
> +
> + <para>Be careful when mixing shares with and without
> + vfs_fruit. OS X clients negotiate SMB2 AAPL protocol
> + extensions on the first tcon, so mixing shares with and
> + without fruit will globally disable AAPL if the first tcon is
> + without fruit.</para>
> +
> <para>Having shares with ADS support enabled for OS X client
> is worthwhile because it resembles the behaviour of Apple's
> own SMB server implementation and it avoids certain severe
> @@ -234,6 +242,7 @@
>
> <programlisting>
> <smbconfsection name="[share]"/>
> + <smbconfoption name="ea support">yes</smbconfoption>
> <smbconfoption name="vfs objects">catia fruit streams_xattr</smbconfoption>
> <smbconfoption name="fruit:resource">file</smbconfoption>
> <smbconfoption name="fruit:metadata">netatalk</smbconfoption>
> --
> 2.5.0
>
More information about the samba-technical
mailing list