Ignore:
Timestamp:
Nov 24, 2016, 1:14:11 PM (9 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: update vendor to version 4.4.3

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/source4/libcli/cliconnect.c

    r740 r988  
    2727#include "libcli/auth/libcli_auth.h"
    2828#include "libcli/smb_composite/smb_composite.h"
     29#include "libcli/smb/smbXcli_base.h"
    2930
    3031/*
     
    3637                           struct resolve_context *resolve_ctx,
    3738                           struct smbcli_options *options,
    38                const char *socket_options)
    39 {
    40         struct smbcli_socket *sock;
    41 
    42         sock = smbcli_sock_connect_byname(server, ports, NULL,
    43                                           resolve_ctx, ev_ctx,
    44                       socket_options);
    45 
    46         if (sock == NULL) return false;
    47        
    48         cli->transport = smbcli_transport_init(sock, cli, true, options);
    49         if (!cli->transport) {
     39                           const char *socket_options,
     40                           struct nbt_name *calling,
     41                           struct nbt_name *called)
     42{
     43        NTSTATUS status;
     44
     45        cli->options = *options;
     46
     47        status = smbcli_sock_connect(cli,
     48                                     NULL, /* host_addr */
     49                                     ports,
     50                                     server,
     51                                     resolve_ctx,
     52                                     ev_ctx,
     53                                     socket_options,
     54                                     calling,
     55                                     called,
     56                                     &cli->sock);
     57        if (!NT_STATUS_IS_OK(status)) {
    5058                return false;
    5159        }
    5260
    5361        return true;
    54 }
    55 
    56 /* wrapper around smbcli_transport_connect() */
    57 bool smbcli_transport_establish(struct smbcli_state *cli,
    58                                 struct nbt_name *calling,
    59                                 struct nbt_name *called)
    60 {
    61         return smbcli_transport_connect(cli->transport, calling, called);
    6262}
    6363
     
    6565NTSTATUS smbcli_negprot(struct smbcli_state *cli, bool unicode, int maxprotocol)
    6666{
    67         return smb_raw_negotiate(cli->transport, unicode, maxprotocol);
     67        if (unicode) {
     68                cli->options.unicode = 1;
     69        } else {
     70                cli->options.unicode = 0;
     71        }
     72
     73        cli->transport = smbcli_transport_init(cli->sock, cli,
     74                                               true, &cli->options);
     75        cli->sock = NULL;
     76        if (!cli->transport) {
     77                return NT_STATUS_NO_MEMORY;
     78        }
     79
     80        return smb_raw_negotiate(cli->transport, unicode, PROTOCOL_CORE, maxprotocol);
    6881}
    6982
     
    113126        /* setup a tree connect */
    114127        tcon.generic.level = RAW_TCON_TCONX;
    115         tcon.tconx.in.flags = 0;
     128        tcon.tconx.in.flags = TCONX_FLAG_EXTENDED_RESPONSE;
     129        tcon.tconx.in.flags |= TCONX_FLAG_EXTENDED_SIGNATURES;
    116130        if (cli->transport->negotiate.sec_mode & NEGOTIATE_SECURITY_USER_LEVEL) {
    117131                tcon.tconx.in.password = data_blob(NULL, 0);
     
    131145
    132146        cli->tree->tid = tcon.tconx.out.tid;
     147
     148        if (tcon.tconx.out.options & SMB_EXTENDED_SIGNATURES) {
     149                smb1cli_session_protect_session_key(cli->tree->session->smbXcli);
     150        }
    133151
    134152        talloc_free(mem_ctx);
Note: See TracChangeset for help on using the changeset viewer.