mirror of
https://github.com/samba-team/samba.git
synced 2025-01-10 01:18:15 +03:00
vfs_fruit: Add Time Machine support
Add a configuration option to disable/enable Time Machine support via the FULLSYNC AAPL flag. Signed-off-by: Kevin Anderson <andersonkw2@gmail.com> Reviewed-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
064e17c0d6
commit
174e6cb5e6
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user