From: Ralph Boehme Date: Sun, 30 Jun 2019 12:24:59 +0000 (+0200) Subject: vfs_fruit: make "fruit:zero_file_id" a per share option X-Git-Tag: ldb-2.0.5~97 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=eb986786562d2551743e97f5cd59d59f574657ca;p=thirdparty%2Fsamba.git vfs_fruit: make "fruit:zero_file_id" a per share option Now that File-ID calculation goes through the VFS, we can nicely make a per-share option out of it. Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- diff --git a/docs-xml/manpages/vfs_fruit.8.xml b/docs-xml/manpages/vfs_fruit.8.xml index c5bd593a139..364b1536f66 100644 --- a/docs-xml/manpages/vfs_fruit.8.xml +++ b/docs-xml/manpages/vfs_fruit.8.xml @@ -143,23 +143,6 @@ - - fruit:zero_file_id = yes | no - - A global option whether to return - zero to queries of on-disk file identifier, if the client - has negotiated AAPL. - Mac applications and / or the Mac SMB - client code expect the on-disk file identifier to have the - semantics of HFS+ Catalog Node Identifier (CNID). Samba - doesn't provide those semantics, and that occasionally cause - usability issues or even data loss. Returning a file identifier - of zero causes the Mac client to stop using and trusting the - file id returned from the server. - The default is yes. - - - fruit:model = MacSamba @@ -407,6 +390,22 @@ + + fruit:zero_file_id = yes | no + + Whether to return zero to queries of on-disk file + identifier if the client has negotiated AAPL. + Mac applications and / or the Mac SMB client code expect the + on-disk file identifier to have the semantics of HFS+ Catalog Node + Identifier (CNID). Samba provides File-IDs based on a file's + initial creation date if the option is enabled. Returning a file identifier of + zero causes the Mac client to stop using and trusting the file id + returned from the server. + The default is yes. + + + diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm index 34a9864cd48..6ce61a8b4ed 100755 --- a/selftest/target/Samba3.pm +++ b/selftest/target/Samba3.pm @@ -1995,6 +1995,13 @@ sub provision($$$$$$$$$) fruit:delete_empty_adfiles = true fruit:veto_appledouble = no +[vfs_fruit_zero_fileid] + path = $shrdir + vfs objects = fruit streams_xattr acl_xattr xattr_tdb + fruit:resource = file + fruit:metadata = stream + fruit:zero_file_id=yes + [badname-tmp] path = $badnames_shrdir guest ok = yes diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c index 02b6d0dc0f6..ea97cb93b30 100644 --- a/source3/modules/vfs_fruit.c +++ b/source3/modules/vfs_fruit.c @@ -2225,7 +2225,8 @@ static int init_fruit_config(vfs_handle_struct *handle) SNUM(handle->conn), FRUIT_PARAM_TYPE_NAME, "posix_rename", true); config->aapl_zero_file_id = - lp_parm_bool(-1, FRUIT_PARAM_TYPE_NAME, "zero_file_id", true); + lp_parm_bool(SNUM(handle->conn), FRUIT_PARAM_TYPE_NAME, + "zero_file_id", true); config->readdir_attr_rsize = lp_parm_bool( SNUM(handle->conn), "readdir_attr", "aapl_rsize", true); @@ -7141,7 +7142,9 @@ static uint64_t fruit_fs_file_id(struct vfs_handle_struct *handle, struct fruit_config_data, return 0); - if (config->aapl_zero_file_id) { + if (global_fruit_config.nego_aapl && + config->aapl_zero_file_id) + { return 0; } diff --git a/source3/selftest/tests.py b/source3/selftest/tests.py index a3cd890e903..5ef227732be 100755 --- a/source3/selftest/tests.py +++ b/source3/selftest/tests.py @@ -616,7 +616,7 @@ for t in tests: elif t == "vfs.fruit_timemachine": plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/vfs_fruit_timemachine -U$USERNAME%$PASSWORD --option=torture:localdir=$SELFTEST_PREFIX/nt4_dc/share') elif t == "vfs.fruit_file_id": - plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/vfs_fruit -U$USERNAME%$PASSWORD') + plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/vfs_fruit_zero_fileid -U$USERNAME%$PASSWORD') elif t == "vfs.fruit_conversion": plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD --option=torture:share2=vfs_fruit_wipe_intentionally_left_blank_rfork --option=torture:delete_empty_adfiles=false', 'wipe_intentionally_left_blank_rfork') plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD --option=torture:share2=vfs_fruit_delete_empty_adfiles --option=torture:delete_empty_adfiles=true', 'delete_empty_adfiles')