The branch, v4-17-test has been updated via f53ef993ffc shadow_copy2: Fix stream open for streams_depot paths via 8c9945e24b2 streams_depot: Create files when requested from 8011cea58e3 rpcd_mdssvc: initialize POSIX locking
https://git.samba.org/?p=samba.git;a=shortlog;h=v4-17-test - Log ----------------------------------------------------------------- commit f53ef993ffc22a470b3cb7a0430e3e6093398f19 Author: Volker Lendecke <v...@samba.org> Date: Fri Apr 14 17:22:18 2023 +0200 shadow_copy2: Fix stream open for streams_depot paths streams_depot hands us absolute paths with : filename components instead of having set smb_fname_in->stream_name. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15358 Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> Autobuild-User(master): Jeremy Allison <j...@samba.org> Autobuild-Date(master): Mon Apr 17 18:11:07 UTC 2023 on atb-devel-224 (cherry picked from commit 526f381f413d1cb5cde93b9542034f5ebfcfcc10) Autobuild-User(v4-17-test): Jule Anger <jan...@samba.org> Autobuild-Date(v4-17-test): Tue Apr 18 16:22:04 UTC 2023 on sn-devel-184 commit 8c9945e24b21c183150c999f227863df76aabb8e Author: Volker Lendecke <v...@samba.org> Date: Fri Apr 14 16:32:42 2023 +0200 streams_depot: Create files when requested If you set "create mask = 0600" no streams will be created.... Tested manually. Not creating an automated test for this, there are so many places where this can go wrong that testing this individual glitch does not gain us much confidence. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15357 Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> (cherry picked from commit 081e808ab4ac6e187b9791da322eb7173e1e133c) ----------------------------------------------------------------------- Summary of changes: source3/modules/vfs_shadow_copy2.c | 25 ++++++++++++++++--------- source3/modules/vfs_streams_depot.c | 2 +- 2 files changed, 17 insertions(+), 10 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/modules/vfs_shadow_copy2.c b/source3/modules/vfs_shadow_copy2.c index a3a6afbc3ac..db221655a3e 100644 --- a/source3/modules/vfs_shadow_copy2.c +++ b/source3/modules/vfs_shadow_copy2.c @@ -1521,15 +1521,22 @@ static struct smb_filename *shadow_copy2_openat_name( if (fsp->base_fsp != NULL) { struct smb_filename *base_fname = fsp->base_fsp->fsp_name; - SMB_ASSERT(is_named_stream(smb_fname_in)); - - result = synthetic_smb_fname( - mem_ctx, - base_fname->base_name, - smb_fname_in->stream_name, - &smb_fname_in->st, - smb_fname_in->twrp, - smb_fname_in->flags); + if (smb_fname_in->base_name[0] == '/') { + /* + * Special-case stream names from streams_depot + */ + result = cp_smb_filename(mem_ctx, smb_fname_in); + } else { + + SMB_ASSERT(is_named_stream(smb_fname_in)); + + result = synthetic_smb_fname(mem_ctx, + base_fname->base_name, + smb_fname_in->stream_name, + &smb_fname_in->st, + smb_fname_in->twrp, + smb_fname_in->flags); + } } else { result = full_path_from_dirfsp_atname( mem_ctx, dirfsp, smb_fname_in); diff --git a/source3/modules/vfs_streams_depot.c b/source3/modules/vfs_streams_depot.c index f92e9c8c5fa..83019fa07da 100644 --- a/source3/modules/vfs_streams_depot.c +++ b/source3/modules/vfs_streams_depot.c @@ -690,7 +690,7 @@ static int streams_depot_openat(struct vfs_handle_struct *handle, SMB_ASSERT(dirfsp == NULL); SMB_ASSERT(VALID_STAT(fsp->base_fsp->fsp_name->st)); - create_it = (how->mode & O_CREAT); + create_it = (how->flags & O_CREAT); /* Determine the stream name, and then open it. */ status = stream_smb_fname( -- Samba Shared Repository