s3:libsmb: get rid of cli_negprot
authorLuk Claes <luk@debian.org>
Sun, 20 May 2012 15:54:29 +0000 (17:54 +0200)
committerStefan Metzmacher <metze@samba.org>
Mon, 28 May 2012 12:49:49 +0000 (14:49 +0200)
Signed-off-by: Luk Claes <luk@debian.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
12 files changed:
source3/libsmb/cliconnect.c
source3/libsmb/clidfs.c
source3/libsmb/libsmb_server.c
source3/libsmb/passchange.c
source3/libsmb/proto.h
source3/nmbd/nmbd_synclists.c
source3/torture/locktest.c
source3/torture/masktest.c
source3/torture/torture.c
source3/utils/net_rpc.c
source3/utils/net_time.c
source3/winbindd/winbindd_cm.c

index a9ac383964ec88434dcb1c63b462075062c17971..491b7039f954f409b9a6a09c25aadffebd32ae19 100644 (file)
@@ -2606,27 +2606,6 @@ fail:
        return status;
 }
 
-struct tevent_req *cli_negprot_send(TALLOC_CTX *mem_ctx,
-                                   struct event_context *ev,
-                                   struct cli_state *cli,
-                                   enum protocol_types max_protocol)
-{
-       return smbXcli_negprot_send(mem_ctx, ev,
-                                   cli->conn, cli->timeout,
-                                   PROTOCOL_CORE, max_protocol);
-}
-
-NTSTATUS cli_negprot_recv(struct tevent_req *req)
-{
-       return smbXcli_negprot_recv(req);
-}
-
-NTSTATUS cli_negprot(struct cli_state *cli, enum protocol_types max_protocol)
-{
-       return smbXcli_negprot(cli->conn, cli->timeout,
-                              PROTOCOL_CORE, max_protocol);
-}
-
 static NTSTATUS cli_connect_sock(const char *host, int name_type,
                                 const struct sockaddr_storage *pss,
                                 const char *myname, uint16_t port,
@@ -2768,7 +2747,8 @@ NTSTATUS cli_start_connection(struct cli_state **output_cli,
                return nt_status;
        }
 
-       nt_status = cli_negprot(cli, PROTOCOL_NT1);
+       nt_status = smbXcli_negprot(cli->conn, cli->timeout, PROTOCOL_CORE,
+                                   PROTOCOL_NT1);
        if (!NT_STATUS_IS_OK(nt_status)) {
                DEBUG(1, ("failed negprot: %s\n", nt_errstr(nt_status)));
                cli_shutdown(cli);
index ff89dcc505013a494bf25c9ea3f4242fb3042d65..8aae42bb86a4219c4a99b4b05d829d5bb88abe67 100644 (file)
@@ -147,7 +147,8 @@ static NTSTATUS do_connect(TALLOC_CTX *ctx,
        }
        DEBUG(4,(" session request ok\n"));
 
-       status = cli_negprot(c, max_protocol);
+       status = smbXcli_negprot(c->conn, c->timeout, PROTOCOL_CORE,
+                                max_protocol);
 
        if (!NT_STATUS_IS_OK(status)) {
                d_printf("protocol negotiation failed: %s\n",
index ccbb6f1aa595dff96d684afdc15b46630d3881ee..c7ec142ffca0f4ee1fff47434bbd81b3ec68834e 100644 (file)
@@ -442,7 +442,8 @@ SMBC_server_internal(TALLOC_CTX *ctx,
 
        cli_set_timeout(c, smbc_getTimeout(context));
 
-       status = cli_negprot(c, PROTOCOL_NT1);
+       status = smbXcli_negprot(c->conn, c->timeout, PROTOCOL_CORE,
+                                PROTOCOL_NT1);
 
        if (!NT_STATUS_IS_OK(status)) {
                cli_shutdown(c);
index ea6d9d5edb7ee8179ccaab612390b433b1829820..393383336bf2bae460fd9ad8e4c78bbde4179b3c 100644 (file)
@@ -24,6 +24,7 @@
 #include "libsmb/libsmb.h"
 #include "libsmb/clirap.h"
 #include "libsmb/nmblib.h"
+#include "../libcli/smb/smbXcli_base.h"
 
 /*************************************************************
  Change a password on a remote machine using IPC calls.
@@ -66,7 +67,8 @@ NTSTATUS remote_password_change(const char *remote_machine, const char *user_nam
                return result;
        }
 
-       result = cli_negprot(cli, PROTOCOL_NT1);
+       result = smbXcli_negprot(cli->conn, cli->timeout, PROTOCOL_CORE,
+                                PROTOCOL_NT1);
 
        if (!NT_STATUS_IS_OK(result)) {
                if (asprintf(err_str, "machine %s rejected the negotiate "
index a584a6376343489119eeb0dee6c88ab46dedd802..3f2595882507b34632b17ff2db21e7191afe661b 100644 (file)
@@ -72,12 +72,6 @@ struct tevent_req *cli_tdis_send(TALLOC_CTX *mem_ctx,
                                  struct cli_state *cli);
 NTSTATUS cli_tdis_recv(struct tevent_req *req);
 NTSTATUS cli_tdis(struct cli_state *cli);
-NTSTATUS cli_negprot(struct cli_state *cli, enum protocol_types max_protocol);
-struct tevent_req *cli_negprot_send(TALLOC_CTX *mem_ctx,
-                                   struct event_context *ev,
-                                   struct cli_state *cli,
-                                   enum protocol_types max_protocol);
-NTSTATUS cli_negprot_recv(struct tevent_req *req);
 NTSTATUS cli_connect_nb(const char *host, const struct sockaddr_storage *dest_ss,
                        uint16_t port, int name_type, const char *myname,
                        int signing_state, int flags, struct cli_state **pcli);
index 20ece6915a0ca169a7856845b68f328e2015d932..d10b580a017e9f90a321d47588ddd45700fa3f49 100644 (file)
@@ -32,6 +32,7 @@
 #include "libsmb/libsmb.h"
 #include "libsmb/clirap.h"
 #include "smbprofile.h"
+#include "../libcli/smb/smbXcli_base.h"
 
 struct sync_record {
        struct sync_record *next, *prev;
@@ -88,7 +89,8 @@ static void sync_child(char *name, int nm_type,
                return;
        }
 
-       status = cli_negprot(cli, PROTOCOL_NT1);
+       status = smbXcli_negprot(cli->conn, cli->timeout, PROTOCOL_CORE,
+                                PROTOCOL_NT1);
        if (!NT_STATUS_IS_OK(status)) {
                cli_shutdown(cli);
                return;
index 288ce8fe543a28a406fc77de7b85030628f61360..04928f20ac85084dfef760310ddbbf0d981ccda0 100644 (file)
@@ -22,6 +22,7 @@
 #include "system/filesys.h"
 #include "locking/proto.h"
 #include "libsmb/nmblib.h"
+#include "../libcli/smb/smbXcli_base.h"
 
 static fstring password[2];
 static fstring username[2];
@@ -198,7 +199,8 @@ static struct cli_state *connect_one(char *share, int snum)
                return NULL;
        }
 
-       status = cli_negprot(c, PROTOCOL_NT1);
+       status = smbXcli_negprot(c->conn, c->timeout, PROTOCOL_CORE,
+                                PROTOCOL_NT1);
        if (!NT_STATUS_IS_OK(status)) {
                DEBUG(0, ("protocol negotiation failed: %s\n",
                          nt_errstr(status)));
index 66699496350848c973bd2210980561195d7cb204..74f33a5cddcea10f77258b81c8d9ad4feceb91b4 100644 (file)
@@ -188,7 +188,8 @@ static struct cli_state *connect_one(char *share)
                return NULL;
        }
 
-       status = cli_negprot(c, max_protocol);
+       status = smbXcli_negprot(c->conn, c->timeout, PROTOCOL_CORE,
+                                max_protocol);
        if (!NT_STATUS_IS_OK(status)) {
                DEBUG(0, ("protocol negotiation failed: %s\n",
                          nt_errstr(status)));
index b49a7a73e24daebf51dc93fe3ba7254c0fb3296e..1f463f66729d69649a1f089ee23f4f70a5122662 100644 (file)
@@ -3053,7 +3053,8 @@ static bool run_negprot_nowait(int dummy)
        for (i=0;i<50000;i++) {
                struct tevent_req *req;
 
-               req = cli_negprot_send(ev, ev, cli, PROTOCOL_NT1);
+               req = smbXcli_negprot_send(ev, ev, cli->conn, cli->timeout,
+                                          PROTOCOL_CORE, PROTOCOL_NT1);
                if (req == NULL) {
                        TALLOC_FREE(ev);
                        return false;
@@ -6307,7 +6308,8 @@ static bool run_error_map_extract(int dummy) {
        }
        disable_spnego = false;
 
-       status = cli_negprot(c_nt, PROTOCOL_NT1);
+       status = smbXcli_negprot(c_nt->conn, c_nt->timeout, PROTOCOL_CORE,
+                                PROTOCOL_NT1);
 
        if (!NT_STATUS_IS_OK(status)) {
                printf("%s rejected the NT-error negprot (%s)\n", host,
@@ -6334,7 +6336,8 @@ static bool run_error_map_extract(int dummy) {
        disable_spnego = false;
        force_dos_errors = false;
 
-       status = cli_negprot(c_dos, PROTOCOL_NT1);
+       status = smbXcli_negprot(c_dos->conn, c_dos->timeout, PROTOCOL_CORE,
+                                PROTOCOL_NT1);
        if (!NT_STATUS_IS_OK(status)) {
                printf("%s rejected the DOS-error negprot (%s)\n", host,
                       nt_errstr(status));
index daae7f449e88294624bcf3a1331ee16a8175233f..49b405f75fdc8cf7208658ba463dd69cd318b902 100644 (file)
@@ -43,7 +43,7 @@
 #include "libsmb/clirap.h"
 #include "nsswitch/libwbclient/wbclient.h"
 #include "passdb.h"
-#include "libcli/smb/smbXcli_base.h"
+#include "../libcli/smb/smbXcli_base.h"
 
 static int net_mode_share;
 static NTSTATUS sync_files(struct copy_clistate *cp_clistate, const char *mask);
@@ -7105,7 +7105,8 @@ bool net_rpc_check(struct net_context *c, unsigned flags)
        if (!NT_STATUS_IS_OK(status)) {
                return false;
        }
-       status = cli_negprot(cli, PROTOCOL_NT1);
+       status = smbXcli_negprot(cli->conn, cli->timeout, PROTOCOL_CORE,
+                                PROTOCOL_NT1);
        if (!NT_STATUS_IS_OK(status))
                goto done;
        if (smbXcli_conn_protocol(cli->conn) < PROTOCOL_NT1)
index 979d29cf91fc9c924db9f5c51a0789d240fbd648..847b4fe445cf0a9c403adf1d3d7d06c2d647db3b 100644 (file)
@@ -41,7 +41,8 @@ static time_t cli_servertime(const char *host,
                goto done;
        }
 
-       status = cli_negprot(cli, PROTOCOL_NT1);
+       status = smbXcli_negprot(cli->conn, cli->timeout, PROTOCOL_CORE,
+                                PROTOCOL_NT1);
        if (!NT_STATUS_IS_OK(status)) {
                fprintf(stderr, _("Protocol negotiation failed: %s\n"),
                        nt_errstr(status));
index d4af23783df7cd354be7a1e4a269a3036a45c8a6..44ca77bc6c8277de19cdebaefede99cff4b19913 100644 (file)
@@ -827,7 +827,8 @@ static NTSTATUS cm_prepare_connection(const struct winbindd_domain *domain,
 
        cli_set_timeout(*cli, 10000); /* 10 seconds */
 
-       result = cli_negprot(*cli, PROTOCOL_SMB2_02);
+       result = smbXcli_negprot((*cli)->conn, (*cli)->timeout, PROTOCOL_CORE,
+                                PROTOCOL_SMB2_02);
 
        if (!NT_STATUS_IS_OK(result)) {
                DEBUG(1, ("cli_negprot failed: %s\n", nt_errstr(result)));