summaryrefslogtreecommitdiff
path: root/source4/librpc/rpc/dcerpc_smb.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2005-06-26 11:35:50 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:18:52 -0500
commita6853cf5c6ed05bbce172da69497fa1501971d57 (patch)
tree5d364769bf85ba53efc512c87cf0dbbdf1c58a71 /source4/librpc/rpc/dcerpc_smb.c
parent173909efd5dd475d5951a98d753fdb6186b66ffb (diff)
downloadsamba-a6853cf5c6ed05bbce172da69497fa1501971d57.tar.gz
samba-a6853cf5c6ed05bbce172da69497fa1501971d57.tar.bz2
samba-a6853cf5c6ed05bbce172da69497fa1501971d57.zip
r7932: don't use the nbt called name as server name, for dcerpc_server_name()
in the ncacn_np trnaport it's now supported to use the ip address in smbtorture for ncacn_np tests that use dcerpc_server_name(), and we can now pass the dns host name in the tree connect when we have the dns name on the smbtorture command line metze (This used to be commit e29edbc7e62c738564ae842c9c01c969f5c70e5d)
Diffstat (limited to 'source4/librpc/rpc/dcerpc_smb.c')
-rw-r--r--source4/librpc/rpc/dcerpc_smb.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/source4/librpc/rpc/dcerpc_smb.c b/source4/librpc/rpc/dcerpc_smb.c
index df421fb16d..88ed1923ca 100644
--- a/source4/librpc/rpc/dcerpc_smb.c
+++ b/source4/librpc/rpc/dcerpc_smb.c
@@ -29,6 +29,7 @@
struct smb_private {
uint16_t fnum;
struct smbcli_tree *tree;
+ const char *server_name;
};
@@ -340,7 +341,7 @@ static NTSTATUS smb_shutdown_pipe(struct dcerpc_connection *c)
static const char *smb_peer_name(struct dcerpc_connection *c)
{
struct smb_private *smb = c->transport.private;
- return smb->tree->session->transport->called.name;
+ return smb->server_name;
}
/*
@@ -404,9 +405,7 @@ NTSTATUS dcerpc_pipe_open_smb(struct dcerpc_connection *c,
talloc_free(pipe_name_talloc);
- if (!NT_STATUS_IS_OK(status)) {
- return status;
- }
+ NT_STATUS_NOT_OK_RETURN(status);
/*
fill in the transport methods
@@ -424,12 +423,12 @@ NTSTATUS dcerpc_pipe_open_smb(struct dcerpc_connection *c,
c->security_state.session_key = smb_session_key;
smb = talloc(c, struct smb_private);
- if (smb == NULL) {
- return NT_STATUS_NO_MEMORY;
- }
+ NT_STATUS_HAVE_NO_MEMORY(smb);
- smb->fnum = io.ntcreatex.out.fnum;
- smb->tree = tree;
+ smb->fnum = io.ntcreatex.out.fnum;
+ smb->tree = tree;
+ smb->server_name= strupper_talloc(smb, tree->session->transport->socket->hostname);
+ NT_STATUS_HAVE_NO_MEMORY(smb->server_name);
c->transport.private = smb;