1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-25 17:57:42 +03:00

rpc_server: Init local_server_* in make_internal_rpc_pipe_socketpair

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13370
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Apr 11 15:19:19 CEST 2018 on sn-devel-144
This commit is contained in:
Volker Lendecke 2018-04-11 10:42:21 +02:00
parent 462eb4a44c
commit 212815969f
3 changed files with 43 additions and 24 deletions

View File

@ -69,14 +69,16 @@ fail:
return NULL;
}
NTSTATUS make_internal_rpc_pipe_socketpair(TALLOC_CTX *mem_ctx,
struct tevent_context *ev_ctx,
struct messaging_context *msg_ctx,
const char *pipe_name,
const struct ndr_syntax_id *syntax,
const struct tsocket_address *remote_address,
const struct auth_session_info *session_info,
struct npa_state **pnpa)
NTSTATUS make_internal_rpc_pipe_socketpair(
TALLOC_CTX *mem_ctx,
struct tevent_context *ev_ctx,
struct messaging_context *msg_ctx,
const char *pipe_name,
const struct ndr_syntax_id *syntax,
const struct tsocket_address *remote_address,
const struct tsocket_address *local_address,
const struct auth_session_info *session_info,
struct npa_state **pnpa)
{
TALLOC_CTX *tmp_ctx = talloc_stackframe();
struct named_pipe_client *npc;
@ -136,6 +138,19 @@ NTSTATUS make_internal_rpc_pipe_socketpair(TALLOC_CTX *mem_ctx,
goto out;
}
npc->local_server_addr = tsocket_address_copy(local_address, npc);
if (npc->local_server_addr == NULL) {
status = NT_STATUS_NO_MEMORY;
goto out;
}
npc->local_server_name = tsocket_address_inet_addr_string(
npc->local_server_addr, npc);
if (npc->local_server_name == NULL) {
status = NT_STATUS_NO_MEMORY;
goto out;
}
npc->session_info = copy_session_info(npc, session_info);
if (npc->session_info == NULL) {
status = NT_STATUS_NO_MEMORY;

View File

@ -44,14 +44,16 @@ NTSTATUS make_external_rpc_pipe(TALLOC_CTX *mem_ctx,
const struct auth_session_info *session_info,
struct npa_state **pnpa);
NTSTATUS make_internal_rpc_pipe_socketpair(TALLOC_CTX *mem_ctx,
struct tevent_context *ev_ctx,
struct messaging_context *msg_ctx,
const char *pipe_name,
const struct ndr_syntax_id *syntax,
const struct tsocket_address *remote_address,
const struct auth_session_info *session_info,
struct npa_state **pnpa);
NTSTATUS make_internal_rpc_pipe_socketpair(
TALLOC_CTX *mem_ctx,
struct tevent_context *ev_ctx,
struct messaging_context *msg_ctx,
const char *pipe_name,
const struct ndr_syntax_id *syntax,
const struct tsocket_address *remote_address,
const struct tsocket_address *local_address,
const struct auth_session_info *session_info,
struct npa_state **pnpa);
struct np_proxy_state {
uint16_t file_type;

View File

@ -106,14 +106,16 @@ NTSTATUS np_open(TALLOC_CTX *mem_ctx, const char *name,
return NT_STATUS_OBJECT_NAME_NOT_FOUND;
}
status = make_internal_rpc_pipe_socketpair(handle,
ev_ctx,
msg_ctx,
name,
&syntax,
remote_client_address,
session_info,
&npa);
status = make_internal_rpc_pipe_socketpair(
handle,
ev_ctx,
msg_ctx,
name,
&syntax,
remote_client_address,
local_server_address,
session_info,
&npa);
if (!NT_STATUS_IS_OK(status)) {
talloc_free(handle);
return status;