From: Volker Lendecke Date: Fri, 8 Apr 2022 11:27:20 +0000 (+0200) Subject: smbd: Use filename_convert_dirfsp() in reply_ntcreate_and_X() X-Git-Tag: talloc-2.3.4~314 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5efa2ddde3231b389111b57e99b0ccff338ac609;p=thirdparty%2Fsamba.git smbd: Use filename_convert_dirfsp() in reply_ntcreate_and_X() Signed-off-by: Volker Lendecke Reviewed-by: Ralph Boehme --- diff --git a/source3/smbd/smb1_nttrans.c b/source3/smbd/smb1_nttrans.c index 39783c4b3a1..b39465c383f 100644 --- a/source3/smbd/smb1_nttrans.c +++ b/source3/smbd/smb1_nttrans.c @@ -508,6 +508,7 @@ static NTSTATUS get_relative_fid_filename(connection_struct *conn, void reply_ntcreate_and_X(struct smb_request *req) { connection_struct *conn = req->conn; + struct files_struct *dirfsp = NULL; struct smb_filename *smb_fname = NULL; char *fname = NULL; uint32_t flags; @@ -623,12 +624,8 @@ void reply_ntcreate_and_X(struct smb_request *req) } ucf_flags = filename_create_ucf_flags(req, create_disposition); - status = filename_convert(ctx, - conn, - fname, - ucf_flags, - 0, - &smb_fname); + status = filename_convert_dirfsp( + ctx, conn, fname, ucf_flags, 0, &dirfsp, &smb_fname); TALLOC_FREE(case_state); @@ -653,7 +650,7 @@ void reply_ntcreate_and_X(struct smb_request *req) status = SMB_VFS_CREATE_FILE( conn, /* conn */ req, /* req */ - NULL, /* dirfsp */ + dirfsp, /* dirfsp */ smb_fname, /* fname */ access_mask, /* access_mask */ share_access, /* share_access */ @@ -686,7 +683,6 @@ void reply_ntcreate_and_X(struct smb_request *req) } /* Ensure we're pointing at the correct stat struct. */ - TALLOC_FREE(smb_fname); smb_fname = fsp->fsp_name; /*