From: Noel Power Date: Thu, 18 Feb 2021 11:01:10 +0000 (+0000) Subject: s3/smb3: ensure file_set_dosmode is passed valid smb_fname->fsp X-Git-Tag: tevent-0.11.0~1591 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=73a46ac9f348eb4cf1bab462f9c71c9cea4ce955;p=thirdparty%2Fsamba.git s3/smb3: ensure file_set_dosmode is passed valid smb_fname->fsp Signed-off-by: Noel Power Reviewed-by: Jeremy Allison --- diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index 73fa897b594..3adb59e3b46 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -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) {