The branch, v4-8-test has been updated via 129423d3657 s3-vfs-fruit: add close call via c5e171f72e5 s3-vfs-streams_xattr: add close call via 8dc1d8c431a dns: changing onelevel search for wildcard to subtree from cfad63624ce s3:auth_winbind: ignore a missing winbindd as NT4 PDC/BDC without trusts
https://git.samba.org/?p=samba.git;a=shortlog;h=v4-8-test - Log ----------------------------------------------------------------- commit 129423d36572edf48a6931a0e5dab4a8e1acc05e Author: Günther Deschner <g...@samba.org> Date: Tue Dec 18 17:18:33 2018 +0100 s3-vfs-fruit: add close call https://bugzilla.samba.org/show_bug.cgi?id=13725 We cannot always rely on vfs_default to close the fake fds. This mostly is relevant when used with another non-local VFS filesystem module such as gluster. Guenther Signed-off-by: Günther Deschner <g...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> Autobuild-User(master): Jeremy Allison <j...@samba.org> Autobuild-Date(master): Fri Dec 21 07:20:49 CET 2018 on sn-devel-144 (cherry picked from commit ba016939aa91e0806f509c8b8ce9506bebceb7e5) Autobuild-User(v4-8-test): Karolin Seeger <ksee...@samba.org> Autobuild-Date(v4-8-test): Mon Jan 14 14:50:09 CET 2019 on sn-devel-144 commit c5e171f72e5fa873873c3727f61d55ecf2f1639e Author: Günther Deschner <g...@samba.org> Date: Tue Dec 18 17:20:29 2018 +0100 s3-vfs-streams_xattr: add close call https://bugzilla.samba.org/show_bug.cgi?id=13725 We cannot always rely on vfs_default to close the fake fds. This mostly is relevant when used with another non-local VFS filesystem module such as gluster. Guenther Signed-off-by: Günther Deschner <g...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> Autobuild-User(master): Jeremy Allison <j...@samba.org> Autobuild-Date(master): Thu Dec 20 07:18:20 CET 2018 on sn-devel-144 (cherry picked from commit 1b263ed631c86bf4117c9388fce3fa1f24cea4c9) commit 8dc1d8c431add361fa20853f98746fb137b24d14 Author: Aaron Haslett <aaronhasl...@catalyst.net.nz> Date: Wed Jan 9 16:22:40 2019 +1300 dns: changing onelevel search for wildcard to subtree SCOPE_ONELEVEL is used on wildcard dns searches, but onelevel searches currently have a performance problem related to GUID indexing, so this patch changes the search scope to SCOPE_SUBTREE. In this case, as the onelevel and subtree sets of records are roughly the same, and the query is matching against the DN itself, we don't believe there's any benefit in using SCOPE_ONELEVEL over SCOPE_SUBTREE. The onelevel performance problem will be fixed separately later, but in the meantime this solves the DNS performance problem. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13738 Signed-off-by: Aaron Haslett <aaronhasl...@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> Reviewed-by: Gary Lockyer <g...@catalyst.net.nz> (cherry picked from commit ef379880037c10589ceeab7f985e3245817908a4) ----------------------------------------------------------------------- Summary of changes: source3/modules/vfs_fruit.c | 82 +++++++++++++++++++++++++++++++++++ source3/modules/vfs_streams_xattr.c | 26 +++++++++++ source4/dns_server/dnsserver_common.c | 2 +- 3 files changed, 109 insertions(+), 1 deletion(-) Changeset truncated at 500 lines: diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c index 7b24256f0e4..f7e0bbce2ce 100644 --- a/source3/modules/vfs_fruit.c +++ b/source3/modules/vfs_fruit.c @@ -3719,6 +3719,87 @@ static int fruit_open(vfs_handle_struct *handle, return fd; } +static int fruit_close_meta(vfs_handle_struct *handle, + files_struct *fsp) +{ + int ret; + struct fruit_config_data *config = NULL; + + SMB_VFS_HANDLE_GET_DATA(handle, config, + struct fruit_config_data, return -1); + + switch (config->meta) { + case FRUIT_META_STREAM: + ret = SMB_VFS_NEXT_CLOSE(handle, fsp); + break; + + case FRUIT_META_NETATALK: + ret = close(fsp->fh->fd); + fsp->fh->fd = -1; + break; + + default: + DBG_ERR("Unexpected meta config [%d]\n", config->meta); + return -1; + } + + return ret; +} + + +static int fruit_close_rsrc(vfs_handle_struct *handle, + files_struct *fsp) +{ + int ret; + struct fruit_config_data *config = NULL; + + SMB_VFS_HANDLE_GET_DATA(handle, config, + struct fruit_config_data, return -1); + + switch (config->rsrc) { + case FRUIT_RSRC_STREAM: + case FRUIT_RSRC_ADFILE: + ret = SMB_VFS_NEXT_CLOSE(handle, fsp); + break; + + case FRUIT_RSRC_XATTR: + ret = close(fsp->fh->fd); + fsp->fh->fd = -1; + break; + + default: + DBG_ERR("Unexpected rsrc config [%d]\n", config->rsrc); + return -1; + } + + return ret; +} + +static int fruit_close(vfs_handle_struct *handle, + files_struct *fsp) +{ + int ret; + int fd; + + fd = fsp->fh->fd; + + DBG_DEBUG("Path [%s] fd [%d]\n", smb_fname_str_dbg(fsp->fsp_name), fd); + + if (!is_ntfs_stream_smb_fname(fsp->fsp_name)) { + return SMB_VFS_NEXT_CLOSE(handle, fsp); + } + + if (is_afpinfo_stream(fsp->fsp_name)) { + ret = fruit_close_meta(handle, fsp); + } else if (is_afpresource_stream(fsp->fsp_name)) { + ret = fruit_close_rsrc(handle, fsp); + } else { + ret = SMB_VFS_NEXT_CLOSE(handle, fsp); + } + + return ret; +} + static int fruit_rename(struct vfs_handle_struct *handle, const struct smb_filename *smb_fname_src, const struct smb_filename *smb_fname_dst) @@ -6999,6 +7080,7 @@ static struct vfs_fn_pointers vfs_fruit_fns = { .rename_fn = fruit_rename, .rmdir_fn = fruit_rmdir, .open_fn = fruit_open, + .close_fn = fruit_close, .pread_fn = fruit_pread, .pwrite_fn = fruit_pwrite, .pread_send_fn = fruit_pread_send, diff --git a/source3/modules/vfs_streams_xattr.c b/source3/modules/vfs_streams_xattr.c index 7f930d96d6b..907451e639e 100644 --- a/source3/modules/vfs_streams_xattr.c +++ b/source3/modules/vfs_streams_xattr.c @@ -544,6 +544,31 @@ static int streams_xattr_open(vfs_handle_struct *handle, return -1; } +static int streams_xattr_close(vfs_handle_struct *handle, + files_struct *fsp) +{ + int ret; + int fd; + + fd = fsp->fh->fd; + + DBG_DEBUG("streams_xattr_close called [%s] fd [%d]\n", + smb_fname_str_dbg(fsp->fsp_name), fd); + + if (!is_ntfs_stream_smb_fname(fsp->fsp_name)) { + return SMB_VFS_NEXT_CLOSE(handle, fsp); + } + + if (is_ntfs_default_stream_smb_fname(fsp->fsp_name)) { + return SMB_VFS_NEXT_CLOSE(handle, fsp); + } + + ret = close(fd); + fsp->fh->fd = -1; + + return ret; +} + static int streams_xattr_unlink(vfs_handle_struct *handle, const struct smb_filename *smb_fname) { @@ -1669,6 +1694,7 @@ static struct vfs_fn_pointers vfs_streams_xattr_fns = { .fs_capabilities_fn = streams_xattr_fs_capabilities, .connect_fn = streams_xattr_connect, .open_fn = streams_xattr_open, + .close_fn = streams_xattr_close, .stat_fn = streams_xattr_stat, .fstat_fn = streams_xattr_fstat, .lstat_fn = streams_xattr_lstat, diff --git a/source4/dns_server/dnsserver_common.c b/source4/dns_server/dnsserver_common.c index 0dedf689cef..04f8eeab7bf 100644 --- a/source4/dns_server/dnsserver_common.c +++ b/source4/dns_server/dnsserver_common.c @@ -481,7 +481,7 @@ static int dns_wildcard_lookup(struct ldb_context *samdb, samdb, frame, parent, - LDB_SCOPE_ONELEVEL, + LDB_SCOPE_SUBTREE, query, attrs, NULL, -- Samba Shared Repository