summaryrefslogtreecommitdiff
path: root/source4/librpc/rpc
diff options
context:
space:
mode:
Diffstat (limited to 'source4/librpc/rpc')
-rw-r--r--source4/librpc/rpc/dcerpc_connect.c5
-rw-r--r--source4/librpc/rpc/dcerpc_smb.c4
2 files changed, 7 insertions, 2 deletions
diff --git a/source4/librpc/rpc/dcerpc_connect.c b/source4/librpc/rpc/dcerpc_connect.c
index be95f21594..bd05498aed 100644
--- a/source4/librpc/rpc/dcerpc_connect.c
+++ b/source4/librpc/rpc/dcerpc_connect.c
@@ -110,7 +110,10 @@ static struct composite_context *dcerpc_pipe_connect_ncacn_np_smb_send(TALLOC_CT
remote rpc server */
conn->in.dest_host = s->io.binding->host;
conn->in.port = 0;
- conn->in.called_name = s->io.binding->target_hostname;
+ if (s->io.binding->target_hostname == NULL)
+ conn->in.called_name = "*SMBSERVER";
+ else
+ conn->in.called_name = s->io.binding->target_hostname;
conn->in.service = "IPC$";
conn->in.service_type = NULL;
conn->in.workgroup = lp_workgroup();
diff --git a/source4/librpc/rpc/dcerpc_smb.c b/source4/librpc/rpc/dcerpc_smb.c
index 6b43de3358..5064e998dd 100644
--- a/source4/librpc/rpc/dcerpc_smb.c
+++ b/source4/librpc/rpc/dcerpc_smb.c
@@ -430,7 +430,9 @@ struct composite_context *dcerpc_pipe_open_smb_send(struct dcerpc_pipe *p,
/* if we don't have a binding on this pipe yet, then create one */
if (p->binding == NULL) {
NTSTATUS status;
- char *s = talloc_asprintf(p, "ncacn_np:%s", tree->session->transport->socket->hostname);
+ char *s;
+ SMB_ASSERT(tree->session->transport->socket->hostname != NULL);
+ s = talloc_asprintf(p, "ncacn_np:%s", tree->session->transport->socket->hostname);
if (s == NULL) return NULL;
status = dcerpc_parse_binding(p, s, &p->binding);
talloc_free(s);