From 4523a0b47d56423216a052df765e39a2389e80e2 Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Mon, 8 Jun 2020 09:26:41 +0200 Subject: smbd: ensure we do a base open for internal stream deletes Otherwise we're not opening the basefile so fsp->base_fsp remains NULL for fsp handles on streams. As there are some places that use the check (fsp->base_fsp != NULL) to check for stream handles, eg streams_xattr_fstat(), we must ensure it is set otherwise we open a pretty big window for undefined behaviour. Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- source3/smbd/open.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/smbd/open.c') diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 79b72784249..11107ce739f 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -5649,8 +5649,8 @@ static NTSTATUS create_file_unixpath(connection_struct *conn, } if ((conn->fs_capabilities & FILE_NAMED_STREAMS) - && is_ntfs_stream_smb_fname(smb_fname) - && (!(private_flags & NTCREATEX_OPTIONS_PRIVATE_STREAM_DELETE))) { + && is_ntfs_stream_smb_fname(smb_fname)) + { uint32_t base_create_disposition; struct smb_filename *smb_fname_base = NULL; uint32_t base_privflags; -- cgit v1.2.1