summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-07-22 16:31:18 +0200
committerStefan Metzmacher <metze@samba.org>2011-07-22 17:06:09 +0200
commitad40515d1771212d856d790a61aed46048908130 (patch)
tree1d6b2770523ec1a34ec74d1f9196d83974221538
parent77fdebc5e53a0a86debba5e55c590b1d98f801d2 (diff)
downloadsamba-ad40515d1771212d856d790a61aed46048908130.tar.gz
samba-ad40515d1771212d856d790a61aed46048908130.tar.bz2
samba-ad40515d1771212d856d790a61aed46048908130.zip
s3:libsmb/clidfs: make use of cli_state_remote_name()
metze
-rw-r--r--source3/libsmb/clidfs.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/source3/libsmb/clidfs.c b/source3/libsmb/clidfs.c
index 2b0c13c171..97458e5d47 100644
--- a/source3/libsmb/clidfs.c
+++ b/source3/libsmb/clidfs.c
@@ -322,7 +322,10 @@ 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)) {
- if (strequal(server, p->desthost) &&
+ const char *remote_name =
+ cli_state_remote_name(p);
+
+ if (strequal(server, remote_name) &&
strequal(share,p->share)) {
return p;
}
@@ -330,7 +333,10 @@ 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) {
- if (strequal(server, p->desthost) &&
+ const char *remote_name =
+ cli_state_remote_name(p);
+
+ if (strequal(server, remote_name) &&
strequal(share,p->share)) {
return p;
}
@@ -400,7 +406,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->desthost, cli->share );
+ i, cli_state_remote_name(cli), cli->share);
}
}
@@ -567,7 +573,7 @@ static char *cli_dfs_make_full_path(TALLOC_CTX *ctx,
}
return talloc_asprintf(ctx, "%c%s%c%s%c%s",
path_sep,
- cli->desthost,
+ cli_state_remote_name(cli),
path_sep,
cli->share,
path_sep,
@@ -847,7 +853,7 @@ NTSTATUS cli_resolve_path(TALLOC_CTX *ctx,
status = cli_cm_open(ctx,
rootcli,
- rootcli->desthost,
+ cli_state_remote_name(rootcli),
"IPC$",
dfs_auth_info,
false,
@@ -1026,6 +1032,7 @@ bool cli_check_msdfs_proxy(TALLOC_CTX *ctx,
uint16 cnum;
char *newextrapath = NULL;
NTSTATUS status;
+ const char *remote_name = cli_state_remote_name(cli);
if (!cli || !sharename) {
return false;
@@ -1041,7 +1048,7 @@ bool cli_check_msdfs_proxy(TALLOC_CTX *ctx,
/* send a trans2_query_path_info to check for a referral */
- fullpath = talloc_asprintf(ctx, "\\%s\\%s", cli->desthost, sharename );
+ fullpath = talloc_asprintf(ctx, "\\%s\\%s", remote_name, sharename);
if (!fullpath) {
return false;
}
@@ -1089,7 +1096,7 @@ bool cli_check_msdfs_proxy(TALLOC_CTX *ctx,
/* check that this is not a self-referral */
- if (strequal(cli->desthost, *pp_newserver) &&
+ if (strequal(remote_name, *pp_newserver) &&
strequal(sharename, *pp_newshare)) {
return false;
}