]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3/smbd: move some setup code in smbd_smb2_create_send a few lines up
authorRalph Boehme <slow@samba.org>
Thu, 20 Jul 2017 04:03:34 +0000 (06:03 +0200)
committerRalph Boehme <slow@samba.org>
Sat, 21 Oct 2017 12:00:10 +0000 (14:00 +0200)
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>
source3/smbd/smb2_create.c

index e499bc051e73821fe4bd1a43d2d6b4d9eb4d6041..e6c6decf535e88bf68e107c8d43e0b75f33669f3 100644 (file)
@@ -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"));
 
                /*