]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:smbd: change the place where we call dos_mode() when processing SMB2_CREATE
authorRalph Boehme <slow@samba.org>
Mon, 23 Sep 2019 22:15:31 +0000 (15:15 -0700)
committerRalph Boehme <slow@samba.org>
Wed, 2 Oct 2019 08:01:39 +0000 (08:01 +0000)
This is needed for ordinary file or directory opens so the QFID create context
response gets the correct File-ID value via dos_mode() from the DOS attributes
xattr.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14137

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/smb2_create.c

index 61ed72169fb4492e4e164959502b9590b7067e6a..66f4aad8c9e87db91ec4a9e5db2bf9e6bd5f4aa0 100644 (file)
@@ -1274,6 +1274,9 @@ static void smbd_smb2_create_after_exec(struct tevent_req *req)
        DEBUG(10, ("smbd_smb2_create_send: "
                   "response construction phase\n"));
 
+       state->out_file_attributes = dos_mode(state->result->conn,
+                                             state->result->fsp_name);
+
        if (state->mxac != NULL) {
                NTTIME last_write_time;
 
@@ -1472,8 +1475,6 @@ static void smbd_smb2_create_finish(struct tevent_req *req)
                state->out_create_action = state->info;
        }
        result->op->create_action = state->out_create_action;
-       state->out_file_attributes = dos_mode(result->conn,
-                                          result->fsp_name);
 
        state->out_creation_ts = get_create_timespec(smb1req->conn,
                                        result, result->fsp_name);