summaryrefslogtreecommitdiffstats
path: root/source3/libsmb
diff options
context:
space:
mode:
authorLuk Claes <luk@debian.org>2012-05-19 17:31:50 +0200
committerStefan Metzmacher <metze@samba.org>2012-05-28 14:49:45 +0200
commit4f6f4ea93c83fa5154f450e2e43649467e4c2b32 (patch)
tree5d765e8b1d8bcf9215a4dce43585a69ccfc66819 /source3/libsmb
parent987e81b0ee681a25a8e3308169626a2206e3fd26 (diff)
downloadsamba-4f6f4ea93c83fa5154f450e2e43649467e4c2b32.tar.gz
samba-4f6f4ea93c83fa5154f450e2e43649467e4c2b32.tar.xz
samba-4f6f4ea93c83fa5154f450e2e43649467e4c2b32.zip
s3:libsmb: get rid of cli_state_remote_name
Signed-off-by: Luk Claes <luk@debian.org> Signed-off-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/cliconnect.c4
-rw-r--r--source3/libsmb/clidfs.c13
-rw-r--r--source3/libsmb/clientgen.c5
-rw-r--r--source3/libsmb/clifsinfo.c2
-rw-r--r--source3/libsmb/clirap2.c7
-rw-r--r--source3/libsmb/libsmb_dir.c5
-rw-r--r--source3/libsmb/libsmb_server.c7
-rw-r--r--source3/libsmb/proto.h1
8 files changed, 21 insertions, 23 deletions
diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c
index 9c1e3e1275d..63acc925ade 100644
--- a/source3/libsmb/cliconnect.c
+++ b/source3/libsmb/cliconnect.c
@@ -1920,7 +1920,7 @@ static ADS_STATUS cli_session_setup_spnego(struct cli_state *cli,
if (user && *user && cli->got_kerberos_mechanism && cli->use_kerberos) {
ADS_STATUS rc;
- const char *remote_name = cli_state_remote_name(cli);
+ const char *remote_name = smbXcli_conn_remote_name(cli->conn);
if (pass && *pass) {
int ret;
@@ -2335,7 +2335,7 @@ struct tevent_req *cli_tcon_andx_create(TALLOC_CTX *mem_ctx,
* Add the sharename
*/
tmp = talloc_asprintf_strupper_m(talloc_tos(), "\\\\%s\\%s",
- cli_state_remote_name(cli), share);
+ smbXcli_conn_remote_name(cli->conn), share);
if (tmp == NULL) {
TALLOC_FREE(req);
return NULL;
diff --git a/source3/libsmb/clidfs.c b/source3/libsmb/clidfs.c
index 4e9ac0cd262..2c1539c39d2 100644
--- a/source3/libsmb/clidfs.c
+++ b/source3/libsmb/clidfs.c
@@ -25,6 +25,7 @@
#include "msdfs.h"
#include "trans2.h"
#include "libsmb/nmblib.h"
+#include "../libcli/smb/smbXcli_base.h"
/********************************************************************
Important point.
@@ -329,7 +330,7 @@ static struct cli_state *cli_cm_find(struct cli_state *cli,
/* Search to the start of the list. */
for (p = cli; p; p = DLIST_PREV(p)) {
const char *remote_name =
- cli_state_remote_name(p);
+ smbXcli_conn_remote_name(p->conn);
if (strequal(server, remote_name) &&
strequal(share,p->share)) {
@@ -340,7 +341,7 @@ static struct cli_state *cli_cm_find(struct cli_state *cli,
/* Search to the end of the list. */
for (p = cli->next; p; p = p->next) {
const char *remote_name =
- cli_state_remote_name(p);
+ smbXcli_conn_remote_name(p->conn);
if (strequal(server, remote_name) &&
strequal(share,p->share)) {
@@ -412,7 +413,7 @@ void cli_cm_display(struct cli_state *cli)
for (i=0; cli; cli = cli->next,i++ ) {
d_printf("%d:\tserver=%s, share=%s\n",
- i, cli_state_remote_name(cli), cli->share);
+ i, smbXcli_conn_remote_name(cli->conn), cli->share);
}
}
@@ -579,7 +580,7 @@ static char *cli_dfs_make_full_path(TALLOC_CTX *ctx,
}
return talloc_asprintf(ctx, "%c%s%c%s%c%s",
path_sep,
- cli_state_remote_name(cli),
+ smbXcli_conn_remote_name(cli->conn),
path_sep,
cli->share,
path_sep,
@@ -859,7 +860,7 @@ NTSTATUS cli_resolve_path(TALLOC_CTX *ctx,
status = cli_cm_open(ctx,
rootcli,
- cli_state_remote_name(rootcli),
+ smbXcli_conn_remote_name(rootcli->conn),
"IPC$",
dfs_auth_info,
false,
@@ -1044,7 +1045,7 @@ bool cli_check_msdfs_proxy(TALLOC_CTX *ctx,
return false;
}
- remote_name = cli_state_remote_name(cli);
+ remote_name = smbXcli_conn_remote_name(cli->conn);
cnum = cli_state_get_tid(cli);
/* special case. never check for a referral on the IPC$ share */
diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c
index 53c2d36de27..cd68f558ffc 100644
--- a/source3/libsmb/clientgen.c
+++ b/source3/libsmb/clientgen.c
@@ -360,11 +360,6 @@ void cli_shutdown(struct cli_state *cli)
_cli_shutdown(cli);
}
-const char *cli_state_remote_name(struct cli_state *cli)
-{
- return smbXcli_conn_remote_name(cli->conn);
-}
-
const char *cli_state_remote_realm(struct cli_state *cli)
{
return cli->remote_realm;
diff --git a/source3/libsmb/clifsinfo.c b/source3/libsmb/clifsinfo.c
index ad5128e7f8b..e4d3c763243 100644
--- a/source3/libsmb/clifsinfo.c
+++ b/source3/libsmb/clifsinfo.c
@@ -690,7 +690,7 @@ NTSTATUS cli_gss_smb_encryption_start(struct cli_state *cli)
}
status = gensec_set_target_hostname(auth_generic_state->gensec_security,
- cli_state_remote_name(cli));
+ smbXcli_conn_remote_name(cli->conn));
if (!NT_STATUS_IS_OK(status)) {
goto fail;
}
diff --git a/source3/libsmb/clirap2.c b/source3/libsmb/clirap2.c
index 8c8968651b8..ce940419151 100644
--- a/source3/libsmb/clirap2.c
+++ b/source3/libsmb/clirap2.c
@@ -80,6 +80,7 @@
#include "../librpc/gen_ndr/rap.h"
#include "../librpc/gen_ndr/svcctl.h"
#include "libsmb/clirap.h"
+#include "../libcli/smb/smbXcli_base.h"
#define WORDSIZE 2
#define DWORDSIZE 4
@@ -1535,7 +1536,7 @@ bool cli_get_pdc_name(struct cli_state *cli, const char *workgroup, char **pdc_n
} else {
DEBUG(4, ("cli_get_pdc_name: machine %s failed the "
"NetServerEnum call. Error was : %s.\n",
- cli_state_remote_name(cli),
+ smbXcli_conn_remote_name(cli->conn),
win_errstr(W_ERROR(cli->rap_error))));
}
}
@@ -1756,7 +1757,7 @@ bool cli_get_server_name(TALLOC_CTX *mem_ctx, struct cli_state *cli,
* PURPOSE: Remotes a NetServerEnum2 API call to the current server
* requesting server_info_0 level information of machines
* matching the given server type. If the returned server
-* list contains the machine name contained in cli_state_remote_name()
+* list contains the machine name contained in smbXcli_conn_remote_name(->conn)
* then we conclude the server type checks out. This routine
* is useful to retrieve list of server's of a certain
* type when all you have is a null session connection and
@@ -1791,7 +1792,7 @@ bool cli_ns_check_server_type(struct cli_state *cli, char *workgroup, uint32 sty
+RAP_MACHNAME_LEN]; /* workgroup */
bool found_server = false;
int res = -1;
- const char *remote_name = cli_state_remote_name(cli);
+ const char *remote_name = smbXcli_conn_remote_name(cli->conn);
/* send a SMBtrans command with api NetServerEnum */
p = make_header(param, RAP_NetServerEnum2,
diff --git a/source3/libsmb/libsmb_dir.c b/source3/libsmb/libsmb_dir.c
index 61d1a726da8..700196c10c6 100644
--- a/source3/libsmb/libsmb_dir.c
+++ b/source3/libsmb/libsmb_dir.c
@@ -30,6 +30,7 @@
#include "rpc_client/cli_pipe.h"
#include "../librpc/gen_ndr/ndr_srvsvc_c.h"
#include "libsmb/nmblib.h"
+#include "../libcli/smb/smbXcli_base.h"
/*
* Routine to open a directory
@@ -554,7 +555,7 @@ SMBC_opendir_ctx(SMBCCTX *context,
}
workgroup = talloc_strdup(frame, wg_ptr);
- server = talloc_strdup(frame, cli_state_remote_name(cli));
+ server = talloc_strdup(frame, smbXcli_conn_remote_name(cli->conn));
cli_shutdown(cli);
@@ -2003,7 +2004,7 @@ SMBC_rename_ctx(SMBCCTX *ocontext,
}
/*d_printf(">>>rename: resolved path as %s\n", targetpath2);*/
- if (strcmp(cli_state_remote_name(targetcli1), cli_state_remote_name(targetcli2)) ||
+ if (strcmp(smbXcli_conn_remote_name(targetcli1->conn), smbXcli_conn_remote_name(targetcli2->conn)) ||
strcmp(targetcli1->share, targetcli2->share))
{
/* can't rename across file systems */
diff --git a/source3/libsmb/libsmb_server.c b/source3/libsmb/libsmb_server.c
index f5fcaea62b0..f9a7599bdbb 100644
--- a/source3/libsmb/libsmb_server.c
+++ b/source3/libsmb/libsmb_server.c
@@ -32,6 +32,7 @@
#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.
@@ -293,7 +294,7 @@ SMBC_server_internal(TALLOC_CTX *ctx,
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,
@@ -371,7 +372,7 @@ SMBC_server_internal(TALLOC_CTX *ctx,
*/
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));
@@ -697,7 +698,7 @@ SMBC_attr_server(TALLOC_CTX *ctx,
if (!srv) {
return NULL;
}
- server = cli_state_remote_name(srv->cli);
+ server = smbXcli_conn_remote_name(srv->cli->conn);
share = srv->cli->share;
/*
diff --git a/source3/libsmb/proto.h b/source3/libsmb/proto.h
index 2ece3378a1e..652e0caf8c3 100644
--- a/source3/libsmb/proto.h
+++ b/source3/libsmb/proto.h
@@ -171,7 +171,6 @@ struct cli_state *cli_state_create(TALLOC_CTX *mem_ctx,
bool cli_state_encryption_on(struct cli_state *cli);
void cli_nt_pipes_close(struct cli_state *cli);
void cli_shutdown(struct cli_state *cli);
-const char *cli_state_remote_name(struct cli_state *cli);
const char *cli_state_remote_realm(struct cli_state *cli);
uint16_t cli_state_get_vc_num(struct cli_state *cli);
uint32_t cli_state_server_session_key(struct cli_state *cli);