]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: ensure we do a base open for internal stream deletes
authorRalph Boehme <slow@samba.org>
Mon, 8 Jun 2020 07:26:41 +0000 (09:26 +0200)
committerJeremy Allison <jra@samba.org>
Sat, 18 Jul 2020 05:58:40 +0000 (05:58 +0000)
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 <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/open.c

index 79b72784249774e1d4d9814baddbbb65e9dee39e..11107ce739feeba8a987865b187dc1bcfa6f7517 100644 (file)
@@ -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;