r16699: the layout of SMB2 Read and Write is identical...
authorStefan Metzmacher <metze@samba.org>
Thu, 29 Jun 2006 22:16:58 +0000 (22:16 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:09:39 +0000 (14:09 -0500)
so we know that the 9th bytes is just uninitialized padding

metze
(This used to be commit f97a21b970ed23973cced2c67b5bc9ecd7afee88)

source4/libcli/raw/interfaces.h
source4/libcli/smb2/read.c
source4/libcli/smb2/write.c
source4/ntvfs/ntvfs_generic.c
source4/smb_server/smb2/fileio.c

index 8b144779f41b9a33e1f7a346c4dcd1eb03a85efe..3665af95481d865fca1cb393e9a030a1ab61cf15 100644 (file)
@@ -1649,7 +1649,6 @@ union smb_read {
                        /* struct smb2_handle handle; */
                        uint64_t unknown1; /* 0x0000000000000000 */
                        uint64_t unknown2; /* 0x0000000000000000 */
-                       uint8_t _bug;
                } in;
                struct {
                        /* static body buffer 16 (0x10) bytes */
@@ -1771,11 +1770,10 @@ union smb_write {
                } in;
                struct {
                        /* static body buffer 17 (0x11) bytes */
-                       /* uint16_t buffer_code;  0x11 */
+                       /* uint16_t buffer_code;  0x11 = 0x10 + 1*/
                        uint16_t _pad;
                        uint32_t nwritten;
                        uint64_t unknown1; /* 0x0000000000000000 */
-                       uint8_t _bug;
                } out;
        } smb2;
 };
index 6806adb8f62c55de0ab7acc99654f35a85cca28f..eb935fb4f1310877a0da06e5b8c18cde6e11a3e4 100644 (file)
@@ -31,7 +31,7 @@ struct smb2_request *smb2_read_send(struct smb2_tree *tree, struct smb2_read *io
 {
        struct smb2_request *req;
 
-       req = smb2_request_init_tree(tree, SMB2_OP_READ, 0x31, False, 0);
+       req = smb2_request_init_tree(tree, SMB2_OP_READ, 0x30, True, 0);
        if (req == NULL) return NULL;
 
        SSVAL(req->out.body, 0x02, 0); /* pad */
@@ -40,7 +40,6 @@ struct smb2_request *smb2_read_send(struct smb2_tree *tree, struct smb2_read *io
        smb2_push_handle(req->out.body+0x10, &io->in.file.handle);
        SBVAL(req->out.body, 0x20, io->in.unknown1);
        SBVAL(req->out.body, 0x28, io->in.unknown2);
-       SCVAL(req->out.body, 0x30, io->in._bug);
 
        smb2_transport_send(req);
 
index 760aadcd8ea8b2f143b51e27b58742067e6c2d15..c9d6ce4b53e61388fc24d9e765cf11a4e576b0e7 100644 (file)
@@ -63,12 +63,11 @@ NTSTATUS smb2_write_recv(struct smb2_request *req, struct smb2_write *io)
                return smb2_request_destroy(req);
        }
 
-       SMB2_CHECK_PACKET_RECV(req, 0x11, False);
+       SMB2_CHECK_PACKET_RECV(req, 0x10, True);
 
        io->out._pad     = SVAL(req->in.body, 0x02);
        io->out.nwritten = IVAL(req->in.body, 0x04);
        io->out.unknown1 = BVAL(req->in.body, 0x08);
-       io->out._bug     = CVAL(req->in.body, 0x10);
 
        return smb2_request_destroy(req);
 }
index 3283ee673dec40cb1421f0ee67dd2c7aaa9bb4c0..5987ff4ba6c74028d0ee94c6e4274553c038e0bf 100644 (file)
@@ -1064,7 +1064,6 @@ static NTSTATUS ntvfs_map_write_finish(struct ntvfs_module_context *ntvfs,
                wr->smb2.out._pad       = 0;
                wr->smb2.out.nwritten   = wr2->generic.out.nwritten;
                wr->smb2.out.unknown1   = 0;
-               wr->smb2.out._bug       = 0;
                break;
 
        default:
index df6808c920dba3ac7dd2afe3ebdeeb5ac294906e..e00452bf81db83d003e828118545781f17885a79 100644 (file)
@@ -178,7 +178,6 @@ void smb2srv_read_recv(struct smb2srv_request *req)
        io->smb2.in.file.ntvfs          = smb2srv_pull_handle(req, req->in.body, 0x10);
        io->smb2.in.unknown1            = BVAL(req->in.body, 0x20);
        io->smb2.in.unknown2            = BVAL(req->in.body, 0x28);
-       io->smb2.in._bug                = CVAL(req->in.body, 0x30);
 
        SMB2SRV_CHECK_FILE_HANDLE(io->smb2.in.file.ntvfs);
 
@@ -202,7 +201,6 @@ static void smb2srv_write_send(struct ntvfs_request *ntvfs)
        SSVAL(req->out.body,    0x02,   io->smb2.out._pad);
        SIVAL(req->out.body,    0x04,   io->smb2.out.nwritten);
        SBVAL(req->out.body,    0x08,   io->smb2.out.unknown1);
-       SCVAL(req->out.body,    0x10,   io->smb2.out._bug);
 
        smb2srv_send_reply(req);
 }