smbd: use synthetic_pathref() in delete_all_streams()
authorRalph Boehme <slow@samba.org>
Wed, 20 Jan 2021 14:27:48 +0000 (15:27 +0100)
committerJeremy Allison <jra@samba.org>
Thu, 28 Jan 2021 08:11:49 +0000 (08:11 +0000)
This ensures backends can use the pathref fsp as needed.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/close.c

index f05619d1886ea3cd8aef3d41fb777a979fb08504..059b9f1518fcd355d26a6c5ef8df0d0a4ff24d8f 100644 (file)
@@ -188,15 +188,16 @@ NTSTATUS delete_all_streams(connection_struct *conn,
                        continue;
                }
 
-               smb_fname_stream = synthetic_smb_fname(talloc_tos(),
-                                       smb_fname->base_name,
-                                       stream_info[i].name,
-                                       NULL,
-                                       smb_fname->twrp,
-                                       (smb_fname->flags &
-                                               ~SMB_FILENAME_POSIX_PATH));
-
-               if (smb_fname_stream == NULL) {
+               status = synthetic_pathref(talloc_tos(),
+                                          conn->cwd_fsp,
+                                          smb_fname->base_name,
+                                          stream_info[i].name,
+                                          NULL,
+                                          smb_fname->twrp,
+                                          (smb_fname->flags &
+                                           ~SMB_FILENAME_POSIX_PATH),
+                                          &smb_fname_stream);
+               if (!NT_STATUS_IS_OK(status)) {
                        DEBUG(0, ("talloc_aprintf failed\n"));
                        status = NT_STATUS_NO_MEMORY;
                        goto fail;