]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3/smb3: ensure file_set_dosmode is passed valid smb_fname->fsp
authorNoel Power <noel.power@suse.com>
Thu, 18 Feb 2021 11:01:10 +0000 (11:01 +0000)
committerJeremy Allison <jra@samba.org>
Thu, 11 Mar 2021 17:50:30 +0000 (17:50 +0000)
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/trans2.c

index 73fa897b594a43d156cccc334ff049afd90c6e88..3adb59e3b46057243f80b60e0aefa3591a0771cb 100644 (file)
@@ -6661,14 +6661,18 @@ static NTSTATUS smb_set_file_dosmode(connection_struct *conn,
        }
 
        /* Always operate on the base_name, even if a stream was passed in. */
-       smb_fname_base = synthetic_smb_fname(talloc_tos(),
+       status = synthetic_pathref(talloc_tos(),
+                                       conn->cwd_fsp,
                                        smb_fname->base_name,
                                        NULL,
-                                       &smb_fname->st,
+                                       NULL,
                                        smb_fname->twrp,
-                                       smb_fname->flags);
-       if (smb_fname_base == NULL) {
-               return NT_STATUS_NO_MEMORY;
+                                       smb_fname->flags,
+                                       &smb_fname_base);
+
+       /* do we handle link as non error here ? */
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
        }
 
        if (dosmode) {