From: Ralph Boehme Date: Mon, 8 Jun 2020 07:26:41 +0000 (+0200) Subject: smbd: ensure we do a base open for internal stream deletes X-Git-Tag: talloc-2.3.2~1074 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4523a0b47d56423216a052df765e39a2389e80e2;p=thirdparty%2Fsamba.git 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 --- 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;