s3/libsmb: Use smbXcli_conn_use_status32 instead of SMB1 specific test
[obnox/samba/samba-obnox.git] / source3 / libsmb / clidfs.c
index 1eaec45eabdaef4bd7ee881fe4cf073afaf55f5d..0e084d09c814cac906501b21ea4cbc5b93ee36e2 100644 (file)
@@ -129,6 +129,9 @@ static NTSTATUS do_connect(TALLOC_CTX *ctx,
        if (get_cmdline_auth_info_use_ccache(auth_info)) {
                flags |= CLI_FULL_CONNECTION_USE_CCACHE;
        }
+       if (get_cmdline_auth_info_use_pw_nt_hash(auth_info)) {
+               flags |= CLI_FULL_CONNECTION_USE_NT_HASH;
+       }
 
        status = cli_connect_nb(
                server, NULL, port, name_type, NULL,
@@ -147,7 +150,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",
@@ -208,7 +212,7 @@ static NTSTATUS do_connect(TALLOC_CTX *ctx,
           here before trying to connect to the original share.
           cli_check_msdfs_proxy() will fail if it is a normal share. */
 
-       if ((smb1cli_conn_capabilities(c->conn) & CAP_DFS) &&
+       if (smbXcli_conn_dfs_supported(c->conn) &&
                        cli_check_msdfs_proxy(ctx, c, sharename,
                                &newserver, &newshare,
                                force_encrypt,
@@ -596,10 +600,10 @@ static bool cli_dfs_check_error(struct cli_state *cli, NTSTATUS expected,
 {
        /* only deal with DS when we negotiated NT_STATUS codes and UNICODE */
 
-       if (!(smb1cli_conn_capabilities(cli->conn) & CAP_UNICODE)) {
+       if (!(smbXcli_conn_use_unicode(cli->conn))) {
                return false;
        }
-       if (!(smb1cli_conn_capabilities(cli->conn) & CAP_STATUS32)) {
+       if (!(smbXcli_conn_use_status32(cli->conn))) {
                return false;
        }
        if (NT_STATUS_EQUAL(status, expected)) {
@@ -647,7 +651,7 @@ NTSTATUS cli_dfs_get_referral(TALLOC_CTX *ctx,
        }
        SSVAL(param, 0, 0x03);  /* max referral level */
 
-       param = trans2_bytes_push_str(param, cli_ucs2(cli),
+       param = trans2_bytes_push_str(param, smbXcli_conn_use_unicode(cli->conn),
                                      path, strlen(path)+1,
                                      NULL);
        if (!param) {
@@ -864,7 +868,7 @@ NTSTATUS cli_resolve_path(TALLOC_CTX *ctx,
                             "IPC$",
                             dfs_auth_info,
                             false,
-                            cli_state_encryption_on(rootcli),
+                            smb1cli_conn_encryption_on(rootcli->conn),
                             smbXcli_conn_protocol(rootcli->conn),
                             0,
                             0x20,
@@ -915,7 +919,7 @@ NTSTATUS cli_resolve_path(TALLOC_CTX *ctx,
                             share,
                             dfs_auth_info,
                             false,
-                            cli_state_encryption_on(rootcli),
+                            smb1cli_conn_encryption_on(rootcli->conn),
                             smbXcli_conn_protocol(rootcli->conn),
                             0,
                             0x20,