summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorRalph Boehme <slow@samba.org>2017-07-20 06:03:34 +0200
committerRalph Boehme <slow@samba.org>2017-10-21 14:00:10 +0200
commit4179a3e67d390232d794d7a073b9b3110963c266 (patch)
tree75276e62c9372fc5b321784e86035cfb6d184779 /source3/smbd
parent7c5d996e7107e082e78eb94932f7e710ed7a93c9 (diff)
downloadsamba-4179a3e67d390232d794d7a073b9b3110963c266.tar.gz
s3/smbd: move some setup code in smbd_smb2_create_send a few lines up
This is just one of the last steps before splitting out large code parts into _before() and _after() functions. No change in behaviour. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/smb2_create.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/source3/smbd/smb2_create.c b/source3/smbd/smb2_create.c
index e499bc051e7..e6c6decf535 100644
--- a/source3/smbd/smb2_create.c
+++ b/source3/smbd/smb2_create.c
@@ -476,6 +476,7 @@ static struct tevent_req *smbd_smb2_create_send(TALLOC_CTX *mem_ctx,
struct smb2_create_blob *dh2q = NULL;
struct smb2_create_blob *rqls = NULL;
bool replay_operation = false;
+ char *fname = NULL;
if(lp_fake_oplocks(SNUM(smb2req->tcon->compat))) {
requested_oplock_level = SMB2_OPLOCK_LEVEL_NONE;
@@ -518,6 +519,17 @@ static struct tevent_req *smbd_smb2_create_send(TALLOC_CTX *mem_ctx,
TALLOC_FREE(smb2req->subreq);
smb2req->subreq = req;
+ /* these are ignored for SMB2 */
+ in_create_options &= ~(0x10);/* NTCREATEX_OPTIONS_SYNC_ALERT */
+ in_create_options &= ~(0x20);/* NTCREATEX_OPTIONS_ASYNC_ALERT */
+
+ in_file_attributes &= ~FILE_FLAG_POSIX_SEMANTICS;
+
+ fname = talloc_strdup(state, in_name);
+ if (tevent_req_nomem(fname, req)) {
+ return tevent_req_post(req, state->ev);
+ }
+
state->out_context_blobs = talloc_zero(state, struct smb2_create_blobs);
if (tevent_req_nomem(state->out_context_blobs, req)) {
return tevent_req_post(req, state->ev);
@@ -654,7 +666,6 @@ static struct tevent_req *smbd_smb2_create_send(TALLOC_CTX *mem_ctx,
}
info = FILE_WAS_CREATED;
} else {
- char *fname;
struct smb2_create_blob *exta = NULL;
struct ea_list *ea_list = NULL;
struct smb2_create_blob *mxac = NULL;
@@ -703,11 +714,6 @@ static struct tevent_req *smbd_smb2_create_send(TALLOC_CTX *mem_ctx,
}
#endif
- fname = talloc_strdup(state, in_name);
- if (tevent_req_nomem(fname, req)) {
- return tevent_req_post(req, state->ev);
- }
-
if (exta) {
if (!lp_ea_support(SNUM(smb2req->tcon->compat))) {
tevent_req_nterror(req,
@@ -999,12 +1005,6 @@ static struct tevent_req *smbd_smb2_create_send(TALLOC_CTX *mem_ctx,
}
}
- /* these are ignored for SMB2 */
- in_create_options &= ~(0x10);/* NTCREATEX_OPTIONS_SYNC_ALERT */
- in_create_options &= ~(0x20);/* NTCREATEX_OPTIONS_ASYNC_ALERT */
-
- in_file_attributes &= ~FILE_FLAG_POSIX_SEMANTICS;
-
DEBUG(10, ("smbd_smb2_create_send: open execution phase\n"));
/*