summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2009-08-11 18:31:27 +0200
committerStefan Metzmacher <metze@samba.org>2009-08-12 13:27:59 +0200
commitf75934e2dc95d99dfbbc80f26eb3d1d1efe08604 (patch)
treeb6edb4ec2056ceac4172e34193d1b22e173e4cff /source3/smbd
parent7229e9a4762f1fee15708ac20de9c40ce75f85a2 (diff)
downloadsamba-f75934e2dc95d99dfbbc80f26eb3d1d1efe08604.tar.gz
samba-f75934e2dc95d99dfbbc80f26eb3d1d1efe08604.tar.bz2
samba-f75934e2dc95d99dfbbc80f26eb3d1d1efe08604.zip
s3:smbd: as check_path_syntax() changes the string, we need to copy the string before
metze
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/smb2_create.c10
1 files 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);