smbd: DBG_DEBUG raw create contexts received from the client
authorVolker Lendecke <vl@samba.org>
Thu, 9 Feb 2023 16:38:43 +0000 (17:38 +0100)
committerJeremy Allison <jra@samba.org>
Thu, 9 Mar 2023 18:10:33 +0000 (18:10 +0000)
Got

smbd_smb2_request_process_create: Got 2 create blobs
[0]
[0000] 93 AD 25 50 9C B4 11 E7   B4 23 83 DE 96 8B CD 7C   ..%P.... .#.....|
[0000] 05 00 00 00                                         ....
[1]
[0000] 51 46 69 64                                         QFid

from cifs.ko, trying to find out where the "05 00 00 00" comes from..

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/smb2_create.c

index 0f18d5594a46f6541ce3d36fe007a7e93ede15c4..68abb3f5e8292da18184ebe158ffab8821d3c564 100644 (file)
@@ -268,6 +268,26 @@ NTSTATUS smbd_smb2_request_process_create(struct smbd_smb2_request *smb2req)
                return smbd_smb2_request_error(smb2req, status);
        }
 
+       if (CHECK_DEBUGLVL(DBGLVL_DEBUG)) {
+               char *str = talloc_asprintf(
+                       talloc_tos(),
+                       "\nGot %"PRIu32" create blobs\n",
+                       in_context_blobs.num_blobs);
+               uint32_t i;
+
+               for (i=0; i<in_context_blobs.num_blobs; i++) {
+                       struct smb2_create_blob *b =
+                               &in_context_blobs.blobs[i];
+                       talloc_asprintf_addbuf(&str, "[%"PRIu32"]\n", i);
+                       dump_data_addbuf(
+                               (uint8_t *)b->tag, strlen(b->tag), &str);
+                       dump_data_addbuf(
+                               b->data.data, b->data.length, &str);
+               }
+               DBG_DEBUG("%s", str);
+               TALLOC_FREE(str);
+       }
+
        tsubreq = smbd_smb2_create_send(smb2req,
                                       smb2req->sconn->ev_ctx,
                                       smb2req,