s4/libcli: rename previously reserved field in SMB2 LOCK struct
authorSteven Danneman <steven.danneman@isilon.com>
Thu, 19 Nov 2009 01:51:35 +0000 (17:51 -0800)
committerSteven Danneman <steven.danneman@isilon.com>
Wed, 25 Nov 2009 20:55:48 +0000 (12:55 -0800)
The lock.in.reserved field has been renamed lock_sequence in the
SMB 2.1 dialect.  See MS-SMB 2.2.26.

source4/libcli/raw/interfaces.h
source4/libcli/smb2/lock.c
source4/smb_server/smb2/fileio.c
source4/torture/gentest.c
source4/torture/smb2/durable_open.c
source4/torture/smb2/lock.c

index af2158cc16a17207f4acbbbba224c15ecf227103..4ddfc56c2fcb6fc553ed668bd94e7e654420d58b 100644 (file)
@@ -2030,7 +2030,7 @@ union smb_lock {
                        /* static body buffer 48 (0x30) bytes */
                        /* uint16_t buffer_code;  0x30 */
                        uint16_t lock_count;
-                       uint32_t reserved;
+                       uint32_t lock_sequence;
                        /* struct smb2_handle handle; */
                        struct smb2_lock_element {
                                uint64_t offset;
index 62c6e5dba7479d5e160127a975b2ba5815fee7ed..f2a76d876a103ce0dd06a5b362c2e629974772d5 100644 (file)
@@ -39,7 +39,7 @@ struct smb2_request *smb2_lock_send(struct smb2_tree *tree, struct smb2_lock *io
        SSVAL(req->out.body, 0, 0x30);
 
        SSVAL(req->out.body, 0x02, io->in.lock_count);
-       SIVAL(req->out.body, 0x04, io->in.reserved);
+       SIVAL(req->out.body, 0x04, io->in.lock_sequence);
        smb2_push_handle(req->out.body+0x08, &io->in.file.handle);
 
        for (i=0;i<io->in.lock_count;i++) {
index 497a6c531b2149f13eee9b73cca323407c7644d9..26d0a3e8e04868b3e41618eed58e2e9d1aa577c8 100644 (file)
@@ -345,7 +345,7 @@ void smb2srv_lock_recv(struct smb2srv_request *req)
 
        io->smb2.level                  = RAW_LOCK_SMB2;
        io->smb2.in.lock_count          = SVAL(req->in.body, 0x02);
-       io->smb2.in.reserved            = IVAL(req->in.body, 0x04);
+       io->smb2.in.lock_sequence       = IVAL(req->in.body, 0x04);
        io->smb2.in.file.ntvfs          = smb2srv_pull_handle(req, req->in.body, 0x08);
        if (req->in.body_size < 24 + 24*(uint64_t)io->smb2.in.lock_count) {
                DEBUG(0,("%s: lock buffer too small\n", __location__));
index 3d23ad85bc0d3c5fb6cb9ec36598c04b89166f25..b0ab41cb3dbaa4da6610d078729aed49a06b71ea 100644 (file)
@@ -2661,7 +2661,7 @@ static bool handler_smb2_lock(int instance)
        parm[0].level = RAW_LOCK_LOCKX;
        parm[0].in.file.handle.data[0] = gen_fnum(instance);
        parm[0].in.lock_count = gen_lock_count();
-       parm[0].in.reserved = gen_reserved32();
+       parm[0].in.lock_sequence = gen_reserved32();
        
        parm[0].in.locks = talloc_array(current_op.mem_ctx,
                                        struct smb2_lock_element,
index 1b1494657bfed5c8da6d573563a3aa28bbfa984b..d182744b3554fa2a438dc70252b3d511f38e19d8 100644 (file)
@@ -433,7 +433,7 @@ bool test_durable_open_lock(struct torture_context *tctx,
        ZERO_STRUCT(el);
        lck.in.locks            = el;
        lck.in.lock_count       = 0x0001;
-       lck.in.reserved         = 0x00000000;
+       lck.in.lock_sequence    = 0x00000000;
        lck.in.file.handle      = h;
        el[0].offset            = 0;
        el[0].length            = 1;
index 4308ff983c2a63c667d770ca5080d1adf09cc861..67dd76836b9cf4c10234ae85c04ec90149f7f7ee 100644 (file)
@@ -63,7 +63,7 @@ static bool test_valid_request(struct torture_context *torture, struct smb2_tree
        torture_comment(torture, "Test request with 0 locks.\n");
 
        lck.in.lock_count       = 0x0000;
-       lck.in.reserved         = 0x00000000;
+       lck.in.lock_sequence    = 0x00000000;
        lck.in.file.handle      = h;
        el[0].offset            = 0x0000000000000000;
        el[0].length            = 0x0000000000000000;
@@ -73,7 +73,7 @@ static bool test_valid_request(struct torture_context *torture, struct smb2_tree
        CHECK_STATUS(status, NT_STATUS_INVALID_PARAMETER);
 
        lck.in.lock_count       = 0x0000;
-       lck.in.reserved         = 0x00000000;
+       lck.in.lock_sequence    = 0x00000000;
        lck.in.file.handle      = h;
        el[0].offset            = 0;
        el[0].length            = 0;
@@ -83,7 +83,7 @@ static bool test_valid_request(struct torture_context *torture, struct smb2_tree
        CHECK_STATUS(status, NT_STATUS_INVALID_PARAMETER);
 
        lck.in.lock_count       = 0x0001;
-       lck.in.reserved         = 0x00000000;
+       lck.in.lock_sequence    = 0x00000000;
        lck.in.file.handle      = h;
        el[0].offset            = 0;
        el[0].length            = 0;
@@ -106,7 +106,7 @@ static bool test_valid_request(struct torture_context *torture, struct smb2_tree
        lck.in.file.handle.data[0] -=1;
 
        lck.in.lock_count       = 0x0001;
-       lck.in.reserved         = 0x123ab1;
+       lck.in.lock_sequence    = 0x123ab1;
        lck.in.file.handle      = h;
        el[0].offset            = UINT64_MAX;
        el[0].length            = UINT64_MAX;
@@ -121,7 +121,7 @@ static bool test_valid_request(struct torture_context *torture, struct smb2_tree
                CHECK_VALUE(lck.out.reserved, 0);
        }
 
-       lck.in.reserved         = 0x123ab2;
+       lck.in.lock_sequence    = 0x123ab2;
        status = smb2_lock(tree, &lck);
        if (TARGET_SUPPORTS_INVALID_LOCK_RANGE(torture)) {
                CHECK_STATUS(status, NT_STATUS_INVALID_LOCK_RANGE);
@@ -132,7 +132,7 @@ static bool test_valid_request(struct torture_context *torture, struct smb2_tree
        torture_comment(torture, "Test basic lock stacking.\n");
 
        lck.in.lock_count       = 0x0001;
-       lck.in.reserved         = 0x12345678;
+       lck.in.lock_sequence    = 0x12345678;
        lck.in.file.handle      = h;
        el[0].offset            = UINT32_MAX;
        el[0].length            = UINT32_MAX;
@@ -153,7 +153,7 @@ static bool test_valid_request(struct torture_context *torture, struct smb2_tree
        CHECK_VALUE(lck.out.reserved, 0);
 
        lck.in.lock_count       = 0x0001;
-       lck.in.reserved         = 0x87654321;
+       lck.in.lock_sequence    = 0x87654321;
        lck.in.file.handle      = h;
        el[0].offset            = 0x00000000FFFFFFFF;
        el[0].length            = 0x00000000FFFFFFFF;
@@ -163,7 +163,7 @@ static bool test_valid_request(struct torture_context *torture, struct smb2_tree
        CHECK_STATUS(status, NT_STATUS_OK);
 
        lck.in.lock_count       = 0x0001;
-       lck.in.reserved         = 0x1234567;
+       lck.in.lock_sequence    = 0x1234567;
        lck.in.file.handle      = h;
        el[0].offset            = 0x00000000FFFFFFFF;
        el[0].length            = 0x00000000FFFFFFFF;
@@ -180,7 +180,7 @@ static bool test_valid_request(struct torture_context *torture, struct smb2_tree
        torture_comment(torture, "Test flags field permutations.\n");
 
        lck.in.lock_count       = 0x0001;
-       lck.in.reserved         = 0;
+       lck.in.lock_sequence    = 0;
        lck.in.file.handle      = h;
        el[0].offset            = 1;
        el[0].length            = 1;
@@ -231,7 +231,7 @@ static bool test_valid_request(struct torture_context *torture, struct smb2_tree
                                 "requested\n");
 
        lck.in.lock_count       = 2;
-       lck.in.reserved         = 0;
+       lck.in.lock_sequence    = 0;
        lck.in.file.handle      = h;
        el[0].offset            = 9999;
        el[0].length            = 1;
@@ -342,7 +342,7 @@ static bool test_lock_read_write(struct torture_context *torture,
        CHECK_STATUS(status, NT_STATUS_OK);
 
        lck.in.lock_count       = 0x0001;
-       lck.in.reserved         = 0x00000000;
+       lck.in.lock_sequence    = 0x00000000;
        lck.in.file.handle      = h1;
        el[0].offset            = 0;
        el[0].length            = ARRAY_SIZE(buf)/2;
@@ -353,7 +353,7 @@ static bool test_lock_read_write(struct torture_context *torture,
        CHECK_VALUE(lck.out.reserved, 0);
 
        lck.in.lock_count       = 0x0001;
-       lck.in.reserved         = 0x00000000;
+       lck.in.lock_sequence    = 0x00000000;
        lck.in.file.handle      = h1;
        el[0].offset            = ARRAY_SIZE(buf)/2;
        el[0].length            = ARRAY_SIZE(buf)/2;
@@ -413,7 +413,7 @@ static bool test_lock_read_write(struct torture_context *torture,
        CHECK_STATUS(status, s->read_h2_status);
 
        lck.in.lock_count       = 0x0001;
-       lck.in.reserved         = 0x00000000;
+       lck.in.lock_sequence    = 0x00000000;
        lck.in.file.handle      = h1;
        el[0].offset            = ARRAY_SIZE(buf)/2;
        el[0].length            = ARRAY_SIZE(buf)/2;