smbd: Fix create_file_unixpath()'s stream handling
authorVolker Lendecke <vl@samba.org>
Mon, 28 Mar 2022 13:11:48 +0000 (15:11 +0200)
committerJeremy Allison <jra@samba.org>
Tue, 29 Mar 2022 21:32:34 +0000 (21:32 +0000)
Make create_file_unixpath() robust against callers explicitly passing
in ":$DATA" as a stream name indicating the default stream. Right now
we NULL this out in callers, but this might change in the future.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/open.c

index 0d64e534149773e151ee832c866243efff4405f1..04afb624a76128924d5a8dfceda688fcf12f0f13 100644 (file)
@@ -5689,7 +5689,7 @@ static NTSTATUS create_file_unixpath(connection_struct *conn,
 
        if ((conn->fs_capabilities & FILE_NAMED_STREAMS)
            && (access_mask & DELETE_ACCESS)
-           && !is_ntfs_stream_smb_fname(smb_fname)) {
+           && !is_named_stream(smb_fname)) {
                /*
                 * We can't open a file with DELETE access if any of the
                 * streams is open without FILE_SHARE_DELETE