#include "rpc_client/cli_lsarpc.h"
#include "libcli/security/security.h"
#include "libsmb/nmblib.h"
+#include "../libcli/smb/smbXcli_base.h"
/*
* Check a server for being alive and well.
/****************************************************************
* Call the auth_fn with fixed size (fstring) buffers.
***************************************************************/
-void
+static void
SMBC_call_auth_fn(TALLOC_CTX *ctx,
SMBCCTX *context,
const char *server,
* server...
*/
if (srv &&
- *share != '\0' &&
+ share != NULL && *share != '\0' &&
smbc_getOptionOneSharePerServer(context)) {
/*
if (!cli_state_has_tcon(srv->cli)) {
/* Ensure we have accurate auth info */
SMBC_call_auth_fn(ctx, context,
- cli_state_remote_name(srv->cli),
+ smbXcli_conn_remote_name(srv->cli->conn),
srv->cli->share,
pp_workgroup,
pp_username,
* tid.
*/
- status = cli_tcon_andx(srv->cli, srv->cli->share, "?????",
- *pp_password,
- strlen(*pp_password)+1);
+ status = cli_tree_connect(srv->cli,
+ srv->cli->share,
+ "?????",
+ *pp_password,
+ strlen(*pp_password)+1);
if (!NT_STATUS_IS_OK(status)) {
errno = map_errno_from_nt_status(status);
cli_shutdown(srv->cli);
*/
if (srv) {
const char *remote_name =
- cli_state_remote_name(srv->cli);
+ smbXcli_conn_remote_name(srv->cli->conn);
srv->dev = (dev_t)(str_checksum(remote_name) ^
str_checksum(srv->cli->share));
flags |= CLI_FULL_CONNECTION_USE_CCACHE;
}
+ if (smbc_getOptionUseNTHash(context)) {
+ flags |= CLI_FULL_CONNECTION_USE_NT_HASH;
+ }
+
if (share == NULL || *share == '\0' || is_ipc) {
/*
* Try 139 first for IPC$
*/
- status = cli_connect_nb(server_n, NULL, 139, 0x20,
+ status = cli_connect_nb(server_n, NULL, NBT_SMB_PORT, 0x20,
smbc_getNetbiosName(context),
- Undefined, flags, &c);
+ SMB_SIGNING_DEFAULT, flags, &c);
}
if (!NT_STATUS_IS_OK(status)) {
*/
status = cli_connect_nb(server_n, NULL, 0, 0x20,
smbc_getNetbiosName(context),
- Undefined, flags, &c);
+ SMB_SIGNING_DEFAULT, flags, &c);
}
if (!NT_STATUS_IS_OK(status)) {
cli_set_timeout(c, smbc_getTimeout(context));
- status = cli_negprot(c);
+ status = smbXcli_negprot(c->conn, c->timeout, PROTOCOL_CORE,
+ PROTOCOL_NT1);
if (!NT_STATUS_IS_OK(status)) {
cli_shutdown(c);
here before trying to connect to the original share.
cli_check_msdfs_proxy() will fail if it is a normal share. */
- if ((cli_state_capabilities(c) & CAP_DFS) &&
+ if ((smb1cli_conn_capabilities(c->conn) & CAP_DFS) &&
cli_check_msdfs_proxy(ctx, c, share,
&newserver, &newshare,
/* FIXME: cli_check_msdfs_proxy() does
/* must be a normal share */
- status = cli_tcon_andx(c, share, "?????", *pp_password,
- strlen(*pp_password)+1);
+ status = cli_tree_connect(c, share, "?????", *pp_password,
+ strlen(*pp_password)+1);
if (!NT_STATUS_IS_OK(status)) {
errno = map_errno_from_nt_status(status);
cli_shutdown(c);
if (!srv) {
return NULL;
}
- server = cli_state_remote_name(srv->cli);
+ server = smbXcli_conn_remote_name(srv->cli->conn);
share = srv->cli->share;
/*
*pp_workgroup,
*pp_password,
flags,
- Undefined);
+ SMB_SIGNING_DEFAULT);
if (! NT_STATUS_IS_OK(nt_status)) {
DEBUG(1,("cli_full_connection failed! (%s)\n",
nt_errstr(nt_status)));
if (!NT_STATUS_IS_OK(nt_status)) {
errno = SMBC_errno(context, ipc_srv->cli);
cli_shutdown(ipc_srv->cli);
+ free(ipc_srv);
return NULL;
}