diff options
-rw-r--r-- | libcli/smb/smb2_create_ctx.h | 1 | ||||
-rw-r--r-- | source3/modules/vfs_fruit.c | 21 |
2 files changed, 22 insertions, 0 deletions
diff --git a/libcli/smb/smb2_create_ctx.h b/libcli/smb/smb2_create_ctx.h index cb194f5c536..0e0b713e55c 100644 --- a/libcli/smb/smb2_create_ctx.h +++ b/libcli/smb/smb2_create_ctx.h @@ -42,5 +42,6 @@ /* "AAPL" Volume Capabilities bitmap */ #define SMB2_CRTCTX_AAPL_SUPPORT_RESOLVE_ID 1 #define SMB2_CRTCTX_AAPL_CASE_SENSITIVE 2 +#define SMB2_CRTCTX_AAPL_FULL_SYNC 4 #endif diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c index 3ba59967482..5c9e680d299 100644 --- a/source3/modules/vfs_fruit.c +++ b/source3/modules/vfs_fruit.c @@ -139,6 +139,7 @@ struct fruit_config_data { bool posix_rename; bool aapl_zero_file_id; const char *model; + bool time_machine; /* * Additional options, all enabled by default, @@ -1549,6 +1550,9 @@ static int init_fruit_config(vfs_handle_struct *handle) config->use_aapl = lp_parm_bool( -1, FRUIT_PARAM_TYPE_NAME, "aapl", true); + config->time_machine = lp_parm_bool( + SNUM(handle->conn), FRUIT_PARAM_TYPE_NAME, "time machine", false); + config->unix_info_enabled = lp_parm_bool( -1, FRUIT_PARAM_TYPE_NAME, "nfs_aces", true); @@ -2206,6 +2210,10 @@ static NTSTATUS check_aapl(vfs_handle_struct *handle, break; } + if (config->time_machine) { + caps |= SMB2_CRTCTX_AAPL_FULL_SYNC; + } + SBVAL(p, 0, caps); ok = data_blob_append(req, &blob, p, 8); @@ -2637,6 +2645,19 @@ static int fruit_connect(vfs_handle_struct *handle, "0x0d:0xf00d"); } + if (config->time_machine) { + DBG_NOTICE("Enabling durable handles for Time Machine " + "support on [%s]\n", service); + lp_do_parameter(SNUM(handle->conn), "durable handles", "yes"); + lp_do_parameter(SNUM(handle->conn), "kernel oplocks", "no"); + lp_do_parameter(SNUM(handle->conn), "kernel share modes", "no"); + if (!lp_strict_sync(SNUM(handle->conn))) { + DBG_WARNING("Time Machine without strict sync is not " + "recommended!\n"); + } + lp_do_parameter(SNUM(handle->conn), "posix locking", "no"); + } + return rc; } |