vfs_fruit: only veto AppleDouble files with fruit:resource=file
authorRalph Boehme <slow@samba.org>
Thu, 19 Jan 2017 08:30:45 +0000 (09:30 +0100)
committerStefan Metzmacher <metze@samba.org>
Mon, 6 Mar 2017 18:40:23 +0000 (19:40 +0100)
vfs_fruit only creates AppleDouble files itself when "fruit:resource" is
set to "file" (the default). It is only then the these AppleDouble files
should be treated as an internal representation and should be
inaccessible from clients.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=12526>

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(cherry picked from commit 708767da8c366c021d6d15a3ae71d009357c3320)

docs-xml/manpages/vfs_fruit.8.xml
source3/modules/vfs_fruit.c

index fe576a5e24c692e1b49e42ffb5ac8d9c7d1a85d3..fa86b6fc4de2accaaf75f8986a830923715b0ed3 100644 (file)
          <varlistentry>
            <term>fruit:veto_appledouble = yes | no</term>
            <listitem>
-             <para>Whether ._ AppleDouble files are vetoed which
-             prevents the client from seing and accessing internal
-             AppleDouble files created by vfs_fruit itself for the
-             purpose of storing a Mac resource fork.</para>
+             <para><emphasis>Note:</emphasis> this option only applies when
+             <parameter>fruit:resource</parameter> is set to
+             <parameter>file</parameter> (the default).</para>
+
+             <para>When <parameter>fruit:resource</parameter> is set to
+             <parameter>file</parameter>, vfs_fruit may create ._ AppleDouble
+             files. This options controls whether these ._ AppleDouble files
+             are vetoed which prevents the client from accessing them.</para>
              <para>Vetoing ._ files may break some applications, eg
              extracting Mac ZIP archives from Mac clients failes,
              because they contain ._ files. Setting this option to
index f1283c8cbcfa8bfd5c5e4e5b56419a839cb9f6e3..773d0cb5c387fb9d2b7dc206821a844068ba2426 100644 (file)
@@ -1568,9 +1568,12 @@ static int init_fruit_config(vfs_handle_struct *handle)
        }
        config->encoding = (enum fruit_encoding)enumval;
 
-       config->veto_appledouble = lp_parm_bool(
-               SNUM(handle->conn), FRUIT_PARAM_TYPE_NAME,
-               "veto_appledouble", true);
+       if (config->rsrc == FRUIT_RSRC_ADFILE) {
+               config->veto_appledouble = lp_parm_bool(SNUM(handle->conn),
+                                                       FRUIT_PARAM_TYPE_NAME,
+                                                       "veto_appledouble",
+                                                       true);
+       }
 
        config->use_aapl = lp_parm_bool(
                -1, FRUIT_PARAM_TYPE_NAME, "aapl", true);