The branch, master has been updated
       via  b1e44875210 s3-vfs_fruit: add 'fruit:veto_localized' option
      from  5660d11869d lib: docs: talloc: fix a wrong cd command

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit b1e4487521004c650ec1b04b456abd13eed19421
Author: Günther Deschner <g...@samba.org>
Date:   Mon Oct 24 15:42:54 2022 +0200

    s3-vfs_fruit: add 'fruit:veto_localized' option
    
    This new boolean option allows to automatically treat ".localized" as
    vetoed files. Any attempts to access a ".localized" file or directory
    will result in an access failure. MacOS tries to check for the presence
    of such a file to check for the need of localized name display in
    directory listings or checks for .localized directories containing name
    translations).  In large directory listings, typically half of the
    compound SMB2 queries are done for ".localized", causing a significant
    performance impact in particular with clustered filesystems.
    
    More information can be found here:
    
https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/FileSystemAdvancedPT/LocalizingtheNameofaDirectory/LocalizingtheNameofaDirectory.html
    
    Guenther
    
    Signed-off-by: Guenther Deschner <g...@samba.org>
    Reviewed-by: Ralph Boehme <s...@samba.org>
    
    Autobuild-User(master): Günther Deschner <g...@samba.org>
    Autobuild-Date(master): Thu Aug 14 11:08:11 UTC 2025 on atb-devel-224

-----------------------------------------------------------------------

Summary of changes:
 docs-xml/manpages/vfs_fruit.8.xml | 21 +++++++++++++++++++++
 source3/modules/vfs_fruit.c       | 25 +++++++++++++++++++++++++
 2 files changed, 46 insertions(+)


Changeset truncated at 500 lines:

diff --git a/docs-xml/manpages/vfs_fruit.8.xml 
b/docs-xml/manpages/vfs_fruit.8.xml
index 9e27030b660..037fe611c4e 100644
--- a/docs-xml/manpages/vfs_fruit.8.xml
+++ b/docs-xml/manpages/vfs_fruit.8.xml
@@ -426,6 +426,27 @@
            </listitem>
          </varlistentry>
 
+         <varlistentry>
+           <term>fruit:veto_localized = yes | no</term>
+           <listitem>
+
+             <para>When <parameter>fruit:veto_localized</parameter> is set to
+             <parameter>yes</parameter>, vfs_fruit will automatically veto any
+             attempts to access the <emphasis>.localized</emphasis> file or 
directory.
+             These can be created in order to let Mac OS provide localized
+             translations for folder names (typically for localized versions
+             of <emphasis>Desktop</emphasis>, <emphasis>Music</emphasis>, 
etc.).
+             When very large directories are listed a Mac client might do 
queries for
+             the presence of the .localized file for each and every entry in 
that
+             directory listing. In combination with clustered filesystems this 
might
+             have a significant impact on the overal directory listing 
performance.
+             When potential folder name translation is not desired this option 
allows
+             to avoid the additional network overhead by not letting the 
server go
+             down to the filesystem layer for any queries.</para>
+             <para>The default is <emphasis>no</emphasis>.</para>
+
+            </listitem>
+         </varlistentry>
        </variablelist>
 </refsect1>
 
diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c
index 1b72eeec534..6f12c3c5d3e 100644
--- a/source3/modules/vfs_fruit.c
+++ b/source3/modules/vfs_fruit.c
@@ -136,6 +136,7 @@ struct fruit_config_data {
        bool wipe_intentionally_left_blank_rfork;
        bool delete_empty_adfiles;
        bool validate_afpinfo;
+       bool veto_localized;
 
        /*
         * Additional options, all enabled by default,
@@ -378,6 +379,10 @@ static int init_fruit_config(vfs_handle_struct *handle)
                SNUM(handle->conn), FRUIT_PARAM_TYPE_NAME,
                "validate_afpinfo", true);
 
+       config->veto_localized = lp_parm_bool(
+               SNUM(handle->conn), FRUIT_PARAM_TYPE_NAME,
+               "veto_localized", false);
+
        SMB_VFS_HANDLE_SET_DATA(handle, config,
                                NULL, struct fruit_config_data,
                                return -1);
@@ -1364,6 +1369,26 @@ static int fruit_connect(vfs_handle_struct *handle,
                TALLOC_FREE(list);
        }
 
+       if (config->veto_localized) {
+               list = lp_veto_files(talloc_tos(), lp_sub, SNUM(handle->conn));
+
+               if (list) {
+                       newlist = talloc_asprintf(
+                               list,
+                               "%s/.localized/",
+                               list);
+                       lp_do_parameter(SNUM(handle->conn),
+                                       "veto files",
+                                       newlist);
+               } else {
+                       lp_do_parameter(SNUM(handle->conn),
+                                       "veto files",
+                                       "/.localized/");
+               }
+
+               TALLOC_FREE(list);
+       }
+
        if (config->encoding == FRUIT_ENC_NATIVE) {
                lp_do_parameter(SNUM(handle->conn),
                                "catia:mappings",


-- 
Samba Shared Repository

Reply via email to