From: Volker Lendecke Date: Tue, 22 Feb 2022 12:15:02 +0000 (+0100) Subject: torture: Create a base_fsp for a named stream in vfstest X-Git-Tag: tevent-0.12.0~182 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fbce308dd4b59c2669fd85352b6584e5bea9b771;p=thirdparty%2Fsamba.git torture: Create a base_fsp for a named stream in vfstest This will enable a simplification in the stream-handling openat vfs routines. Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/source3/torture/cmd_vfs.c b/source3/torture/cmd_vfs.c index 5346662afa1..7a23f7bf5a2 100644 --- a/source3/torture/cmd_vfs.c +++ b/source3/torture/cmd_vfs.c @@ -405,6 +405,22 @@ static NTSTATUS cmd_open(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, c goto fail; } + if (is_named_stream(smb_fname)) { + struct smb_filename *base_name = NULL; + + base_name = cp_smb_filename_nostream(NULL, smb_fname); + if (base_name == NULL) { + goto nomem; + } + + status = openat_pathref_fsp(fspcwd, base_name); + if (!NT_STATUS_IS_OK(status)) { + goto fail; + } + + fsp->base_fsp = base_name->fsp; + } + fd = SMB_VFS_OPENAT(vfs->conn, fspcwd, smb_fname,