The branch, master has been updated
       via  0b8184d s4:torture/smb2: s/smb2cli_unlock/test_smb2_unlock
       via  43c865a s4:torture/smb2: s/smb2cli_lock/test_smb2_lock
       via  8a22906 s3:libsmb: use clistr_pull_talloc() in cli_qfilename()
       via  a1df729 s3:libsmb: let cli_qfileinfo[_recv]() return recv_flags2
       via  2b0cc3c s3:libsmb: use clistr_pull_talloc() in 
cli_get_fs_volume_info()
       via  27736be s3:libsmb: the SMB_QUERY_FS_VOLUME_INFO response needs at 
least 18 data bytes
       via  bc98d00 s3:libsmb: don't use cli->inbuf in cli_dfs_get_referral()
       via  af61f6f s3:libsmb: fix error handling in cli_dfs_get_referral()
      from  f9601a9 s3:sharesec: return an error if get_share_security() 
returns NULL

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 0b8184d9d40c6ccb10209973e6bbeccee4dc000a
Author: Stefan Metzmacher <me...@samba.org>
Date:   Wed Jul 6 17:52:33 2011 +0200

    s4:torture/smb2: s/smb2cli_unlock/test_smb2_unlock
    
    metze
    
    Autobuild-User: Stefan Metzmacher <me...@samba.org>
    Autobuild-Date: Wed Jul  6 19:07:42 CEST 2011 on sn-devel-104

commit 43c865a38e534ec6f01643f9609cbccd9de976f8
Author: Stefan Metzmacher <me...@samba.org>
Date:   Wed Jul 6 17:52:33 2011 +0200

    s4:torture/smb2: s/smb2cli_lock/test_smb2_lock
    
    metze

commit 8a2290667ca4c530321d366d3dd09f4757e9ac1d
Author: Stefan Metzmacher <me...@samba.org>
Date:   Wed Jul 6 14:35:13 2011 +0200

    s3:libsmb: use clistr_pull_talloc() in cli_qfilename()
    
    metze

commit a1df729f7b498c770a013ddabb38d0b2e8608b67
Author: Stefan Metzmacher <me...@samba.org>
Date:   Wed Jul 6 14:04:15 2011 +0200

    s3:libsmb: let cli_qfileinfo[_recv]() return recv_flags2
    
    metze

commit 2b0cc3c412d2cad5e35728f86cc66109f5dc4676
Author: Stefan Metzmacher <me...@samba.org>
Date:   Wed Jul 6 13:57:20 2011 +0200

    s3:libsmb: use clistr_pull_talloc() in cli_get_fs_volume_info()
    
    metze

commit 27736bed83191ccad69e5ad7732cc8ed60c5864f
Author: Stefan Metzmacher <me...@samba.org>
Date:   Wed Jul 6 13:21:41 2011 +0200

    s3:libsmb: the SMB_QUERY_FS_VOLUME_INFO response needs at least 18 data 
bytes
    
    metze

commit bc98d004c9dc22ff1438bfd1d9ddeaca5a3f6179
Author: Stefan Metzmacher <me...@samba.org>
Date:   Wed Jul 6 13:04:26 2011 +0200

    s3:libsmb: don't use cli->inbuf in cli_dfs_get_referral()
    
    The rdata buffer returned by cli_trans() doesn't belong to
    cli->inbuf, so don't use it.
    
    metze

commit af61f6fce6a219a78238d7187476addaa1e00525
Author: Stefan Metzmacher <me...@samba.org>
Date:   Wed Jul 6 15:57:22 2011 +0200

    s3:libsmb: fix error handling in cli_dfs_get_referral()
    
    We should not return NT_STATUS_OK on error.
    
    metze

-----------------------------------------------------------------------

Summary of changes:
 source3/client/client.c     |    7 +++--
 source3/libsmb/clidfs.c     |   26 +++++++++++++++++-------
 source3/libsmb/clifile.c    |   14 ++++++++++--
 source3/libsmb/clifsinfo.c  |   34 ++++++++++++++++++++++++++------
 source3/libsmb/clirap.c     |   32 ++++++++++++++++++++++++++----
 source3/libsmb/clirap.h     |    7 +++--
 source3/libsmb/proto.h      |    3 +-
 source3/torture/torture.c   |    6 ++--
 source4/torture/smb2/lock.c |   44 +++++++++++++++++++++---------------------
 9 files changed, 118 insertions(+), 55 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/client/client.c b/source3/client/client.c
index e2efad8..aa26d99 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -3767,12 +3767,13 @@ static int cmd_rename(void)
 
 static int cmd_volume(void)
 {
-       fstring volname;
-       uint32 serial_num;
+       char *volname;
+       uint32_t serial_num;
        time_t create_date;
        NTSTATUS status;
 
-       status = cli_get_fs_volume_info(cli, volname, &serial_num,
+       status = cli_get_fs_volume_info(cli, talloc_tos(),
+                                       &volname, &serial_num,
                                        &create_date);
        if (!NT_STATUS_IS_OK(status)) {
                d_printf("Error %s getting volume info\n", nt_errstr(status));
diff --git a/source3/libsmb/clidfs.c b/source3/libsmb/clidfs.c
index 9c0f1f4..2287812 100644
--- a/source3/libsmb/clidfs.c
+++ b/source3/libsmb/clidfs.c
@@ -608,7 +608,8 @@ NTSTATUS cli_dfs_get_referral(TALLOC_CTX *ctx,
 {
        unsigned int data_len = 0;
        unsigned int param_len = 0;
-       uint16 setup[1];
+       uint16_t setup[1];
+       uint16_t recv_flags2;
        uint8_t *param = NULL;
        uint8_t *rdata = NULL;
        char *p;
@@ -643,16 +644,13 @@ NTSTATUS cli_dfs_get_referral(TALLOC_CTX *ctx,
                           setup, 1, 0,
                           param, param_len, 2,
                           NULL, 0, cli->max_xmit,
-                          NULL,
+                          &recv_flags2,
                           NULL, 0, NULL, /* rsetup */
                           NULL, 0, NULL,
                           &rdata, 4, &data_len);
        if (!NT_STATUS_IS_OK(status)) {
                goto out;
        }
-       if (data_len < 4) {
-               goto out;
-       }
 
        endp = (char *)rdata + data_len;
 
@@ -666,6 +664,7 @@ NTSTATUS cli_dfs_get_referral(TALLOC_CTX *ctx,
         * to get the number of bytes consumed from
         * the incoming path. */
 
+       errno = 0;
        if (pull_string_talloc(talloc_tos(),
                        NULL,
                        0,
@@ -673,9 +672,15 @@ NTSTATUS cli_dfs_get_referral(TALLOC_CTX *ctx,
                        path_ucs,
                        consumed_ucs,
                        STR_UNICODE) == 0) {
+               if (errno != 0) {
+                       status = map_nt_error_from_unix(errno);
+               } else {
+                       status = NT_STATUS_INVALID_NETWORK_RESPONSE;
+               }
                goto out;
        }
        if (consumed_path == NULL) {
+               status = map_nt_error_from_unix(errno);
                goto out;
        }
        *consumed = strlen(consumed_path);
@@ -690,6 +695,7 @@ NTSTATUS cli_dfs_get_referral(TALLOC_CTX *ctx,
                                         num_referrals);
 
                if (!referrals) {
+                       status = NT_STATUS_NO_MEMORY;
                        goto out;
                }
                /* start at the referrals array */
@@ -712,21 +718,25 @@ NTSTATUS cli_dfs_get_referral(TALLOC_CTX *ctx,
                        referrals[i].ttl       = SVAL(p, 10);
 
                        if (p + node_offset > endp) {
+                               status = NT_STATUS_INVALID_NETWORK_RESPONSE;
                                goto out;
                        }
-                       clistr_pull_talloc(ctx, cli->inbuf,
-                                          SVAL(cli->inbuf, smb_flg2),
+                       clistr_pull_talloc(referrals,
+                                          (const char *)rdata,
+                                          recv_flags2,
                                           &referrals[i].dfspath,
                                           p+node_offset,
-                                          cli->bufsize - 
((p+node_offset)-cli->inbuf),
+                                          PTR_DIFF(endp, p+node_offset),
                                           STR_TERMINATE|STR_UNICODE);
 
                        if (!referrals[i].dfspath) {
+                               status = map_nt_error_from_unix(errno);
                                goto out;
                        }
                        p += ref_size;
                }
                if (i < num_referrals) {
+                       status = NT_STATUS_INVALID_NETWORK_RESPONSE;
                        goto out;
                }
        }
diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c
index 88cecd5..eab278f 100644
--- a/source3/libsmb/clifile.c
+++ b/source3/libsmb/clifile.c
@@ -5059,6 +5059,7 @@ struct cli_qfileinfo_state {
        uint16_t setup[1];
        uint8_t param[4];
        uint8_t *data;
+       uint16_t recv_flags2;
        uint32_t min_rdata;
        uint8_t *rdata;
        uint32_t num_rdata;
@@ -5118,7 +5119,9 @@ static void cli_qfileinfo_done(struct tevent_req *subreq)
                req, struct cli_qfileinfo_state);
        NTSTATUS status;
 
-       status = cli_trans_recv(subreq, state, NULL, NULL, 0, NULL,
+       status = cli_trans_recv(subreq, state,
+                               &state->recv_flags2,
+                               NULL, 0, NULL,
                                NULL, 0, NULL,
                                &state->rdata, state->min_rdata,
                                &state->num_rdata);
@@ -5129,6 +5132,7 @@ static void cli_qfileinfo_done(struct tevent_req *subreq)
 }
 
 NTSTATUS cli_qfileinfo_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
+                           uint16_t *recv_flags2,
                            uint8_t **rdata, uint32_t *num_rdata)
 {
        struct cli_qfileinfo_state *state = tevent_req_data(
@@ -5138,6 +5142,10 @@ NTSTATUS cli_qfileinfo_recv(struct tevent_req *req, 
TALLOC_CTX *mem_ctx,
        if (tevent_req_is_nterror(req, &status)) {
                return status;
        }
+
+       if (recv_flags2 != NULL) {
+               *recv_flags2 = state->recv_flags2;
+       }
        if (rdata != NULL) {
                *rdata = talloc_move(mem_ctx, &state->rdata);
        } else {
@@ -5151,7 +5159,7 @@ NTSTATUS cli_qfileinfo_recv(struct tevent_req *req, 
TALLOC_CTX *mem_ctx,
 
 NTSTATUS cli_qfileinfo(TALLOC_CTX *mem_ctx, struct cli_state *cli,
                       uint16_t fnum, uint16_t level, uint32_t min_rdata,
-                      uint32_t max_rdata,
+                      uint32_t max_rdata, uint16_t *recv_flags2,
                       uint8_t **rdata, uint32_t *num_rdata)
 {
        TALLOC_CTX *frame = talloc_stackframe();
@@ -5178,7 +5186,7 @@ NTSTATUS cli_qfileinfo(TALLOC_CTX *mem_ctx, struct 
cli_state *cli,
        if (!tevent_req_poll_ntstatus(req, ev, &status)) {
                goto fail;
        }
-       status = cli_qfileinfo_recv(req, mem_ctx, rdata, num_rdata);
+       status = cli_qfileinfo_recv(req, mem_ctx, recv_flags2, rdata, 
num_rdata);
  fail:
        TALLOC_FREE(frame);
        return status;
diff --git a/source3/libsmb/clifsinfo.c b/source3/libsmb/clifsinfo.c
index 78024c8..02b2578 100644
--- a/source3/libsmb/clifsinfo.c
+++ b/source3/libsmb/clifsinfo.c
@@ -354,15 +354,20 @@ fail:
        return status;
 }
 
-NTSTATUS cli_get_fs_volume_info(struct cli_state *cli, fstring volume_name,
-                               uint32 *pserial_number, time_t *pdate)
+NTSTATUS cli_get_fs_volume_info(struct cli_state *cli,
+                               TALLOC_CTX *mem_ctx,
+                               char **_volume_name,
+                               uint32_t *pserial_number,
+                               time_t *pdate)
 {
        NTSTATUS status;
-       uint16 setup[1];
+       uint16_t recv_flags2;
+       uint16_t setup[1];
        uint8_t param[2];
        uint8_t *rdata;
        uint32_t rdata_count;
        unsigned int nlen;
+       char *volume_name = NULL;
 
        SSVAL(setup, 0, TRANSACT2_QFSINFO);
        SSVAL(param,0,SMB_QUERY_FS_VOLUME_INFO);
@@ -372,10 +377,10 @@ NTSTATUS cli_get_fs_volume_info(struct cli_state *cli, 
fstring volume_name,
                           setup, 1, 0,
                           param, 2, 0,
                           NULL, 0, 560,
-                          NULL,
+                          &recv_flags2,
                           NULL, 0, NULL,
                           NULL, 0, NULL,
-                          &rdata, 10, &rdata_count);
+                          &rdata, 18, &rdata_count);
        if (!NT_STATUS_IS_OK(status)) {
                return status;
        }
@@ -389,13 +394,28 @@ NTSTATUS cli_get_fs_volume_info(struct cli_state *cli, 
fstring volume_name,
                *pserial_number = IVAL(rdata,8);
        }
        nlen = IVAL(rdata,12);
-       clistr_pull(cli->inbuf, volume_name, rdata + 18, sizeof(fstring),
-                   nlen, STR_UNICODE);
+       if (nlen > (rdata_count - 18)) {
+               TALLOC_FREE(rdata);
+               return NT_STATUS_INVALID_NETWORK_RESPONSE;
+       }
+
+       clistr_pull_talloc(mem_ctx,
+                          (const char *)rdata,
+                          recv_flags2,
+                          &volume_name,
+                          rdata + 18,
+                          nlen, STR_UNICODE);
+       if (volume_name == NULL) {
+               status = map_nt_error_from_unix(errno);
+               TALLOC_FREE(rdata);
+               return status;
+       }
 
        /* todo: but not yet needed
         *       return the other stuff
         */
 
+       *_volume_name = volume_name;
        TALLOC_FREE(rdata);
        return NT_STATUS_OK;
 }
diff --git a/source3/libsmb/clirap.c b/source3/libsmb/clirap.c
index e5ff1ab..96003c1 100644
--- a/source3/libsmb/clirap.c
+++ b/source3/libsmb/clirap.c
@@ -1064,23 +1064,44 @@ static bool parse_streams_blob(TALLOC_CTX *mem_ctx, 
const uint8_t *rdata,
  Send a qfileinfo QUERY_FILE_NAME_INFO call.
 ****************************************************************************/
 
-NTSTATUS cli_qfilename(struct cli_state *cli, uint16_t fnum, char *name,
-                      size_t namelen)
+NTSTATUS cli_qfilename(struct cli_state *cli, uint16_t fnum,
+                      TALLOC_CTX *mem_ctx, char **_name)
 {
+       uint16_t recv_flags2;
        uint8_t *rdata;
        uint32_t num_rdata;
        NTSTATUS status;
+       char *name = NULL;
+       uint32_t namelen;
 
        status = cli_qfileinfo(talloc_tos(), cli, fnum,
                               SMB_QUERY_FILE_NAME_INFO,
-                              4, cli->max_xmit,
+                              4, cli->max_xmit, &recv_flags2,
                               &rdata, &num_rdata);
        if (!NT_STATUS_IS_OK(status)) {
                return status;
        }
 
-       clistr_pull((const char *)rdata, name, rdata+4, namelen, IVAL(rdata, 0),
-                   STR_UNICODE);
+       namelen = IVAL(rdata, 0);
+       if (namelen > (num_rdata - 4)) {
+               TALLOC_FREE(rdata);
+               return NT_STATUS_INVALID_NETWORK_RESPONSE;
+       }
+
+       clistr_pull_talloc(mem_ctx,
+                          (const char *)rdata,
+                          recv_flags2,
+                          &name,
+                          rdata + 4,
+                          namelen,
+                          STR_UNICODE);
+       if (name == NULL) {
+               status = map_nt_error_from_unix(errno);
+               TALLOC_FREE(rdata);
+               return status;
+       }
+
+       *_name = name;
        TALLOC_FREE(rdata);
        return NT_STATUS_OK;
 }
@@ -1110,6 +1131,7 @@ NTSTATUS cli_qfileinfo_basic(struct cli_state *cli, 
uint16_t fnum,
        status = cli_qfileinfo(talloc_tos(), cli, fnum,
                               SMB_QUERY_FILE_ALL_INFO,
                               68, MIN(cli->max_xmit, 0xffff),
+                              NULL,
                               &rdata, &num_rdata);
        if (!NT_STATUS_IS_OK(status)) {
                return status;
diff --git a/source3/libsmb/clirap.h b/source3/libsmb/clirap.h
index 26265de..de770db 100644
--- a/source3/libsmb/clirap.h
+++ b/source3/libsmb/clirap.h
@@ -94,8 +94,8 @@ NTSTATUS cli_qpathinfo_streams(struct cli_state *cli, const 
char *fname,
                               TALLOC_CTX *mem_ctx,
                               unsigned int *pnum_streams,
                               struct stream_struct **pstreams);
-NTSTATUS cli_qfilename(struct cli_state *cli, uint16_t fnum, char *name,
-                      size_t namelen);
+NTSTATUS cli_qfilename(struct cli_state *cli, uint16_t fnum,
+                      TALLOC_CTX *mem_ctx, char **name);
 NTSTATUS cli_qfileinfo_basic(struct cli_state *cli, uint16_t fnum,
                             uint16 *mode, SMB_OFF_T *size,
                             struct timespec *create_time,
@@ -130,10 +130,11 @@ struct tevent_req *cli_qfileinfo_send(TALLOC_CTX *mem_ctx,
                                      uint16_t level, uint32_t min_rdata,
                                      uint32_t max_rdata);
 NTSTATUS cli_qfileinfo_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
+                           uint16_t *recv_flags2,
                            uint8_t **rdata, uint32_t *num_rdata);
 NTSTATUS cli_qfileinfo(TALLOC_CTX *mem_ctx, struct cli_state *cli,
                       uint16_t fnum, uint16_t level, uint32_t min_rdata,
-                      uint32_t max_rdata,
+                      uint32_t max_rdata, uint16_t *recv_flags2,
                       uint8_t **rdata, uint32_t *num_rdata);
 
 struct tevent_req *cli_flush_send(TALLOC_CTX *mem_ctx,
diff --git a/source3/libsmb/proto.h b/source3/libsmb/proto.h
index 89f5857..1919b08 100644
--- a/source3/libsmb/proto.h
+++ b/source3/libsmb/proto.h
@@ -611,7 +611,8 @@ struct tevent_req *cli_get_fs_attr_info_send(TALLOC_CTX 
*mem_ctx,
                                             struct cli_state *cli);
 NTSTATUS cli_get_fs_attr_info_recv(struct tevent_req *req, uint32_t *fs_attr);
 NTSTATUS cli_get_fs_attr_info(struct cli_state *cli, uint32_t *fs_attr);
-NTSTATUS cli_get_fs_volume_info(struct cli_state *cli, fstring volume_name,
+NTSTATUS cli_get_fs_volume_info(struct cli_state *cli,
+                               TALLOC_CTX *mem_ctx, char **volume_name,
                                uint32 *pserial_number, time_t *pdate);
 NTSTATUS cli_get_fs_full_size_info(struct cli_state *cli,
                                   uint64_t *total_allocation_units,
diff --git a/source3/torture/torture.c b/source3/torture/torture.c
index faa4326..7e2a5e7 100644
--- a/source3/torture/torture.c
+++ b/source3/torture/torture.c
@@ -3096,7 +3096,7 @@ static bool run_trans2test(int dummy)
        const char *fname = "\\trans2.tst";
        const char *dname = "\\trans2";
        const char *fname2 = "\\trans2\\trans2.tst";
-       char pname[1024];
+       char *pname;
        bool correct = True;
        NTSTATUS status;
        uint32_t fs_attr;
@@ -3123,7 +3123,7 @@ static bool run_trans2test(int dummy)
                correct = False;
        }
 
-       status = cli_qfilename(cli, fnum, pname, sizeof(pname));
+       status = cli_qfilename(cli, fnum, talloc_tos(), &pname);
        if (!NT_STATUS_IS_OK(status)) {
                printf("ERROR: qfilename failed (%s)\n", nt_errstr(status));
                correct = False;
@@ -3246,7 +3246,7 @@ static NTSTATUS new_trans(struct cli_state *pcli, int 
fnum, int level)
        NTSTATUS status;
 
        status = cli_qfileinfo(talloc_tos(), pcli, fnum, level, 0,
-                              pcli->max_xmit, &buf, &len);
+                              pcli->max_xmit, NULL, &buf, &len);
        if (!NT_STATUS_IS_OK(status)) {
                printf("ERROR: qfileinfo (%d) failed (%s)\n", level,
                       nt_errstr(status));
diff --git a/source4/torture/smb2/lock.c b/source4/torture/smb2/lock.c
index fe82813..3483126 100644
--- a/source4/torture/smb2/lock.c
+++ b/source4/torture/smb2/lock.c
@@ -2608,8 +2608,8 @@ done:
        return ret;
 }
 
-static NTSTATUS smb2cli_lock(struct smb2_tree *tree, struct smb2_handle h,
-                            uint64_t offset, uint64_t length, bool exclusive)
+static NTSTATUS test_smb2_lock(struct smb2_tree *tree, struct smb2_handle h,
+                              uint64_t offset, uint64_t length, bool exclusive)
 {
        struct smb2_lock lck;
        struct smb2_lock_element el[1];
@@ -2632,8 +2632,8 @@ static NTSTATUS smb2cli_lock(struct smb2_tree *tree, 
struct smb2_handle h,
        return status;
 }
 
-static NTSTATUS smb2cli_unlock(struct smb2_tree *tree, struct smb2_handle h,
-                              uint64_t offset, uint64_t length)
+static NTSTATUS test_smb2_unlock(struct smb2_tree *tree, struct smb2_handle h,
+                                uint64_t offset, uint64_t length)
 {
        struct smb2_lock lck;
        struct smb2_lock_element el[1];
@@ -2693,45 +2693,45 @@ static bool test_overlap(struct torture_context 
*torture,
 
        torture_comment(torture, "Testing overlapping locks:\n");
 
-       ret = NT_STATUS_IS_OK(smb2cli_lock(tree, h, 0, 4, true)) &&
-             NT_STATUS_IS_OK(smb2cli_lock(tree, h, 2, 4, true));
+       ret = NT_STATUS_IS_OK(test_smb2_lock(tree, h, 0, 4, true)) &&
+             NT_STATUS_IS_OK(test_smb2_lock(tree, h, 2, 4, true));
        EXPECTED(ret, false);
        torture_comment(torture, "the same session/handle %s set overlapping "
                                 "exclusive locks\n", ret?"can":"cannot");
 
-       ret = NT_STATUS_IS_OK(smb2cli_lock(tree, h, 10, 4, false)) &&
-             NT_STATUS_IS_OK(smb2cli_lock(tree, h, 12, 4, false));
+       ret = NT_STATUS_IS_OK(test_smb2_lock(tree, h, 10, 4, false)) &&
+             NT_STATUS_IS_OK(test_smb2_lock(tree, h, 12, 4, false));
        EXPECTED(ret, true);
        torture_comment(torture, "the same session/handle %s set overlapping "
                                 "shared locks\n", ret?"can":"cannot");
 
-       ret = NT_STATUS_IS_OK(smb2cli_lock(tree, h, 20, 4, true)) &&
-             NT_STATUS_IS_OK(smb2cli_lock(tree2, h3, 22, 4, true));
+       ret = NT_STATUS_IS_OK(test_smb2_lock(tree, h, 20, 4, true)) &&
+             NT_STATUS_IS_OK(test_smb2_lock(tree2, h3, 22, 4, true));
        EXPECTED(ret, false);
        torture_comment(torture, "a different session %s set overlapping "
                                 "exclusive locks\n", ret?"can":"cannot");
 
-       ret = NT_STATUS_IS_OK(smb2cli_lock(tree, h, 30, 4, false)) &&
-             NT_STATUS_IS_OK(smb2cli_lock(tree2, h3, 32, 4, false));
+       ret = NT_STATUS_IS_OK(test_smb2_lock(tree, h, 30, 4, false)) &&
+             NT_STATUS_IS_OK(test_smb2_lock(tree2, h3, 32, 4, false));
        EXPECTED(ret, true);
        torture_comment(torture, "a different session %s set overlapping "
                                 "shared locks\n", ret?"can":"cannot");
 
-       ret = NT_STATUS_IS_OK(smb2cli_lock(tree, h, 40, 4, true)) &&
-             NT_STATUS_IS_OK(smb2cli_lock(tree, h2, 42, 4, true));
+       ret = NT_STATUS_IS_OK(test_smb2_lock(tree, h, 40, 4, true)) &&
+             NT_STATUS_IS_OK(test_smb2_lock(tree, h2, 42, 4, true));
        EXPECTED(ret, false);
        torture_comment(torture, "a different handle %s set overlapping "
                                 "exclusive locks\n", ret?"can":"cannot");
 
-       ret = NT_STATUS_IS_OK(smb2cli_lock(tree, h, 50, 4, false)) &&
-             NT_STATUS_IS_OK(smb2cli_lock(tree, h2, 52, 4, false));
+       ret = NT_STATUS_IS_OK(test_smb2_lock(tree, h, 50, 4, false)) &&
+             NT_STATUS_IS_OK(test_smb2_lock(tree, h2, 52, 4, false));
        EXPECTED(ret, true);
        torture_comment(torture, "a different handle %s set overlapping "
                                 "shared locks\n", ret?"can":"cannot");
 
-       ret = NT_STATUS_IS_OK(smb2cli_lock(tree, h, 110, 4, false)) &&
-             NT_STATUS_IS_OK(smb2cli_lock(tree, h, 112, 4, false)) &&
-             NT_STATUS_IS_OK(smb2cli_unlock(tree, h, 110, 6));
+       ret = NT_STATUS_IS_OK(test_smb2_lock(tree, h, 110, 4, false)) &&
+             NT_STATUS_IS_OK(test_smb2_lock(tree, h, 112, 4, false)) &&
+             NT_STATUS_IS_OK(test_smb2_unlock(tree, h, 110, 6));
        EXPECTED(ret, false);
        torture_comment(torture, "the same handle %s coalesce read locks\n",
                                 ret?"can":"cannot");
@@ -2742,11 +2742,11 @@ static bool test_overlap(struct torture_context 
*torture,
        CHECK_STATUS(status, NT_STATUS_OK);
        status = torture_smb2_testfile(tree, fname, &h2);
        CHECK_STATUS(status, NT_STATUS_OK);
-       ret = NT_STATUS_IS_OK(smb2cli_lock(tree, h, 0, 8, false)) &&
-             NT_STATUS_IS_OK(smb2cli_lock(tree, h2, 0, 1, false)) &&
+       ret = NT_STATUS_IS_OK(test_smb2_lock(tree, h, 0, 8, false)) &&
+             NT_STATUS_IS_OK(test_smb2_lock(tree, h2, 0, 1, false)) &&
              NT_STATUS_IS_OK(smb2_util_close(tree, h)) &&
              NT_STATUS_IS_OK(torture_smb2_testfile(tree, fname, &h)) &&
-             NT_STATUS_IS_OK(smb2cli_lock(tree, h, 7, 1, true));
+             NT_STATUS_IS_OK(test_smb2_lock(tree, h, 7, 1, true));
        EXPECTED(ret, true);
        torture_comment(torture, "the server %s have the NT byte range lock "
                                 "bug\n", !ret?"does":"doesn't");


-- 
Samba Shared Repository

Reply via email to