From f75934e2dc95d99dfbbc80f26eb3d1d1efe08604 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 11 Aug 2009 18:31:27 +0200 Subject: s3:smbd: as check_path_syntax() changes the string, we need to copy the string before metze --- source3/smbd/smb2_create.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/source3/smbd/smb2_create.c b/source3/smbd/smb2_create.c index 707b014388..fe414bb897 100644 --- a/source3/smbd/smb2_create.c +++ b/source3/smbd/smb2_create.c @@ -315,14 +315,20 @@ static struct tevent_req *smbd_smb2_create_send(TALLOC_CTX *mem_ctx, } info = FILE_WAS_CREATED; } else { + char *fname; struct smb_filename *smb_fname = NULL; /* these are ignored for SMB2 */ in_create_options &= ~(0x10);/* NTCREATEX_OPTIONS_SYNC_ALERT */ in_create_options &= ~(0x20);/* NTCREATEX_OPTIONS_ASYNC_ALERT */ + fname = talloc_strdup(state, in_name); + if (tevent_req_nomem(fname, req)) { + return tevent_req_post(req, ev); + } + /* convert '\\' into '/' */ - status = check_path_syntax(in_name); + status = check_path_syntax(fname); if (!NT_STATUS_IS_OK(status)) { tevent_req_nterror(req, status); return tevent_req_post(req, ev); @@ -331,7 +337,7 @@ static struct tevent_req *smbd_smb2_create_send(TALLOC_CTX *mem_ctx, status = filename_convert(req, smbreq->conn, smbreq->flags2 & FLAGS2_DFS_PATHNAMES, - in_name, + fname, 0, NULL, &smb_fname); -- cgit