s4:libcli: remember return code from maximum access
authorRalph Boehme <slow@samba.org>
Thu, 28 Feb 2019 13:47:18 +0000 (14:47 +0100)
committerKarolin Seeger <kseeger@samba.org>
Mon, 11 Mar 2019 08:59:33 +0000 (08:59 +0000)
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13812

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
(cherry picked from commit 9f4ee05295827c9a607e1f63694a17906f777176)

source4/libcli/raw/interfaces.h
source4/libcli/smb2/create.c

index 732ba1512dc279ab1a0ccbe70d238be72d84462f..43a53f834dfe90bc73b35e24553c46a1573f5d19 100644 (file)
@@ -1779,6 +1779,7 @@ union smb_open {
                        /* uint32_t blob_size; */
 
                        /* optional return values matching tagged values in the call */
+                       uint32_t maximal_access_status;
                        uint32_t maximal_access;
                        uint8_t on_disk_id[32];
                        struct smb2_lease lease_response;
index 550069a6cea1b18664f6c3665471b55fad4cf5b6..eb0f6a421cd18b0271584f9c44b61e3128e2f4de 100644 (file)
@@ -360,12 +360,12 @@ NTSTATUS smb2_create_recv(struct smb2_request *req, TALLOC_CTX *mem_ctx, struct
        /* pull out the parsed blobs */
        for (i=0;i<io->out.blobs.num_blobs;i++) {
                if (strcmp(io->out.blobs.blobs[i].tag, SMB2_CREATE_TAG_MXAC) == 0) {
-                       /* TODO: this also contains a status field in
-                          first 4 bytes */
                        if (io->out.blobs.blobs[i].data.length != 8) {
                                smb2_request_destroy(req);
                                return NT_STATUS_INVALID_NETWORK_RESPONSE;
                        }
+                       io->out.maximal_access_status =
+                               IVAL(io->out.blobs.blobs[i].data.data, 0);
                        io->out.maximal_access = IVAL(io->out.blobs.blobs[i].data.data, 4);
                }
                if (strcmp(io->out.blobs.blobs[i].tag, SMB2_CREATE_TAG_QFID) == 0) {