Changeset 988 for vendor/current/source4/libcli/cliconnect.c
- Timestamp:
- Nov 24, 2016, 1:14:11 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/source4/libcli/cliconnect.c
r740 r988 27 27 #include "libcli/auth/libcli_auth.h" 28 28 #include "libcli/smb_composite/smb_composite.h" 29 #include "libcli/smb/smbXcli_base.h" 29 30 30 31 /* … … 36 37 struct resolve_context *resolve_ctx, 37 38 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)) { 50 58 return false; 51 59 } 52 60 53 61 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);62 62 } 63 63 … … 65 65 NTSTATUS smbcli_negprot(struct smbcli_state *cli, bool unicode, int maxprotocol) 66 66 { 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); 68 81 } 69 82 … … 113 126 /* setup a tree connect */ 114 127 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; 116 130 if (cli->transport->negotiate.sec_mode & NEGOTIATE_SECURITY_USER_LEVEL) { 117 131 tcon.tconx.in.password = data_blob(NULL, 0); … … 131 145 132 146 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 } 133 151 134 152 talloc_free(mem_ctx);
Note:
See TracChangeset
for help on using the changeset viewer.