summaryrefslogtreecommitdiff
path: root/source4/libcli/cliconnect.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/libcli/cliconnect.c')
-rw-r--r--source4/libcli/cliconnect.c35
1 files changed, 17 insertions, 18 deletions
diff --git a/source4/libcli/cliconnect.c b/source4/libcli/cliconnect.c
index e0f3c598b4..a56100fc80 100644
--- a/source4/libcli/cliconnect.c
+++ b/source4/libcli/cliconnect.c
@@ -25,28 +25,29 @@
#include "libcli/raw/libcliraw.h"
#include "libcli/auth/libcli_auth.h"
#include "libcli/smb_composite/smb_composite.h"
+#include "param/param.h"
/*
wrapper around smbcli_sock_connect()
*/
-BOOL smbcli_socket_connect(struct smbcli_state *cli, const char *server)
+bool smbcli_socket_connect(struct smbcli_state *cli, const char *server)
{
struct smbcli_socket *sock;
sock = smbcli_sock_connect_byname(server, 0, NULL, NULL);
- if (sock == NULL) return False;
+ if (sock == NULL) return false;
- cli->transport = smbcli_transport_init(sock, cli, True);
+ cli->transport = smbcli_transport_init(sock, cli, true);
if (!cli->transport) {
- return False;
+ return false;
}
- return True;
+ return true;
}
/* wrapper around smbcli_transport_connect() */
-BOOL smbcli_transport_establish(struct smbcli_state *cli,
+bool smbcli_transport_establish(struct smbcli_state *cli,
struct nbt_name *calling,
struct nbt_name *called)
{
@@ -56,7 +57,8 @@ BOOL smbcli_transport_establish(struct smbcli_state *cli,
/* wrapper around smb_raw_negotiate() */
NTSTATUS smbcli_negprot(struct smbcli_state *cli)
{
- return smb_raw_negotiate(cli->transport, lp_cli_maxprotocol());
+ return smb_raw_negotiate(cli->transport,
+ lp_cli_maxprotocol(global_loadparm));
}
/* wrapper around smb_raw_sesssetup() */
@@ -66,13 +68,13 @@ NTSTATUS smbcli_session_setup(struct smbcli_state *cli,
struct smb_composite_sesssetup setup;
NTSTATUS status;
- cli->session = smbcli_session_init(cli->transport, cli, True);
+ cli->session = smbcli_session_init(cli->transport, cli, true);
if (!cli->session) return NT_STATUS_UNSUCCESSFUL;
setup.in.sesskey = cli->transport->negotiate.sesskey;
setup.in.capabilities = cli->transport->negotiate.capabilities;
setup.in.credentials = credentials;
- setup.in.workgroup = lp_workgroup();
+ setup.in.workgroup = lp_workgroup(global_loadparm);
status = smb_composite_sesssetup(cli->session, &setup);
@@ -89,7 +91,7 @@ NTSTATUS smbcli_tconX(struct smbcli_state *cli, const char *sharename,
TALLOC_CTX *mem_ctx;
NTSTATUS status;
- cli->tree = smbcli_tree_init(cli->session, cli, True);
+ cli->tree = smbcli_tree_init(cli->session, cli, true);
if (!cli->tree) return NT_STATUS_UNSUCCESSFUL;
mem_ctx = talloc_init("tcon");
@@ -205,7 +207,7 @@ terminate_path_at_separator(char * path)
/*
parse a //server/share type UNC name
*/
-BOOL smbcli_parse_unc(const char *unc_name, TALLOC_CTX *mem_ctx,
+bool smbcli_parse_unc(const char *unc_name, TALLOC_CTX *mem_ctx,
char **hostname, char **sharename)
{
char *p;
@@ -214,28 +216,25 @@ BOOL smbcli_parse_unc(const char *unc_name, TALLOC_CTX *mem_ctx,
if (strncmp(unc_name, "\\\\", 2) &&
strncmp(unc_name, "//", 2)) {
- return False;
+ return false;
}
*hostname = talloc_strdup(mem_ctx, &unc_name[2]);
p = terminate_path_at_separator(*hostname);
- if (p && *p) {
+ if (p != NULL && *p) {
*sharename = talloc_strdup(mem_ctx, p);
terminate_path_at_separator(*sharename);
- } else {
- *sharename = talloc_strdup(mem_ctx,
- lp_parm_string(-1, "torture", "share"));
}
if (*hostname && *sharename) {
- return True;
+ return true;
}
talloc_free(*hostname);
talloc_free(*sharename);
*hostname = *sharename = NULL;
- return False;
+ return false;
}