|
|
080bbf |
From 2f6d1b8b5a1643082d93f338b0528b861caeff80 Mon Sep 17 00:00:00 2001
|
|
|
080bbf |
From: Volker Lendecke <vl@samba.org>
|
|
|
080bbf |
Date: Wed, 11 Apr 2018 10:42:21 +0200
|
|
|
080bbf |
Subject: [PATCH] rpc_server: Init local_server_* in
|
|
|
080bbf |
make_internal_rpc_pipe_socketpair
|
|
|
080bbf |
|
|
|
080bbf |
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13370
|
|
|
080bbf |
Signed-off-by: Volker Lendecke <vl@samba.org>
|
|
|
080bbf |
Reviewed-by: Stefan Metzmacher <metze@samba.org>
|
|
|
080bbf |
|
|
|
080bbf |
Autobuild-User(master): Volker Lendecke <vl@samba.org>
|
|
|
080bbf |
Autobuild-Date(master): Wed Apr 11 15:19:19 CEST 2018 on sn-devel-144
|
|
|
080bbf |
|
|
|
080bbf |
(cherry picked from commit 212815969f4a706bc8395e2f6dbf225318ff2ad7)
|
|
|
080bbf |
---
|
|
|
080bbf |
source3/rpc_server/rpc_ncacn_np.c | 31 +++++++++++++++++++++++--------
|
|
|
080bbf |
source3/rpc_server/rpc_ncacn_np.h | 18 ++++++++++--------
|
|
|
080bbf |
source3/rpc_server/srv_pipe_hnd.c | 18 ++++++++++--------
|
|
|
080bbf |
3 files changed, 43 insertions(+), 24 deletions(-)
|
|
|
080bbf |
|
|
|
080bbf |
diff --git a/source3/rpc_server/rpc_ncacn_np.c b/source3/rpc_server/rpc_ncacn_np.c
|
|
|
080bbf |
index 0728f54b092..d7e7785248d 100644
|
|
|
080bbf |
--- a/source3/rpc_server/rpc_ncacn_np.c
|
|
|
080bbf |
+++ b/source3/rpc_server/rpc_ncacn_np.c
|
|
|
080bbf |
@@ -69,14 +69,16 @@ fail:
|
|
|
080bbf |
return NULL;
|
|
|
080bbf |
}
|
|
|
080bbf |
|
|
|
080bbf |
-NTSTATUS make_internal_rpc_pipe_socketpair(TALLOC_CTX *mem_ctx,
|
|
|
080bbf |
- struct tevent_context *ev_ctx,
|
|
|
080bbf |
- struct messaging_context *msg_ctx,
|
|
|
080bbf |
- const char *pipe_name,
|
|
|
080bbf |
- const struct ndr_syntax_id *syntax,
|
|
|
080bbf |
- const struct tsocket_address *remote_address,
|
|
|
080bbf |
- const struct auth_session_info *session_info,
|
|
|
080bbf |
- struct npa_state **pnpa)
|
|
|
080bbf |
+NTSTATUS make_internal_rpc_pipe_socketpair(
|
|
|
080bbf |
+ TALLOC_CTX *mem_ctx,
|
|
|
080bbf |
+ struct tevent_context *ev_ctx,
|
|
|
080bbf |
+ struct messaging_context *msg_ctx,
|
|
|
080bbf |
+ const char *pipe_name,
|
|
|
080bbf |
+ const struct ndr_syntax_id *syntax,
|
|
|
080bbf |
+ const struct tsocket_address *remote_address,
|
|
|
080bbf |
+ const struct tsocket_address *local_address,
|
|
|
080bbf |
+ const struct auth_session_info *session_info,
|
|
|
080bbf |
+ struct npa_state **pnpa)
|
|
|
080bbf |
{
|
|
|
080bbf |
TALLOC_CTX *tmp_ctx = talloc_stackframe();
|
|
|
080bbf |
struct named_pipe_client *npc;
|
|
|
080bbf |
@@ -136,6 +138,19 @@ NTSTATUS make_internal_rpc_pipe_socketpair(TALLOC_CTX *mem_ctx,
|
|
|
080bbf |
goto out;
|
|
|
080bbf |
}
|
|
|
080bbf |
|
|
|
080bbf |
+ npc->local_server_addr = tsocket_address_copy(local_address, npc);
|
|
|
080bbf |
+ if (npc->local_server_addr == NULL) {
|
|
|
080bbf |
+ status = NT_STATUS_NO_MEMORY;
|
|
|
080bbf |
+ goto out;
|
|
|
080bbf |
+ }
|
|
|
080bbf |
+
|
|
|
080bbf |
+ npc->local_server_name = tsocket_address_inet_addr_string(
|
|
|
080bbf |
+ npc->local_server_addr, npc);
|
|
|
080bbf |
+ if (npc->local_server_name == NULL) {
|
|
|
080bbf |
+ status = NT_STATUS_NO_MEMORY;
|
|
|
080bbf |
+ goto out;
|
|
|
080bbf |
+ }
|
|
|
080bbf |
+
|
|
|
080bbf |
npc->session_info = copy_session_info(npc, session_info);
|
|
|
080bbf |
if (npc->session_info == NULL) {
|
|
|
080bbf |
status = NT_STATUS_NO_MEMORY;
|
|
|
080bbf |
diff --git a/source3/rpc_server/rpc_ncacn_np.h b/source3/rpc_server/rpc_ncacn_np.h
|
|
|
080bbf |
index 03bbd3f8af9..9ba58644ec0 100644
|
|
|
080bbf |
--- a/source3/rpc_server/rpc_ncacn_np.h
|
|
|
080bbf |
+++ b/source3/rpc_server/rpc_ncacn_np.h
|
|
|
080bbf |
@@ -44,14 +44,16 @@ NTSTATUS make_external_rpc_pipe(TALLOC_CTX *mem_ctx,
|
|
|
080bbf |
const struct auth_session_info *session_info,
|
|
|
080bbf |
struct npa_state **pnpa);
|
|
|
080bbf |
|
|
|
080bbf |
-NTSTATUS make_internal_rpc_pipe_socketpair(TALLOC_CTX *mem_ctx,
|
|
|
080bbf |
- struct tevent_context *ev_ctx,
|
|
|
080bbf |
- struct messaging_context *msg_ctx,
|
|
|
080bbf |
- const char *pipe_name,
|
|
|
080bbf |
- const struct ndr_syntax_id *syntax,
|
|
|
080bbf |
- const struct tsocket_address *remote_address,
|
|
|
080bbf |
- const struct auth_session_info *session_info,
|
|
|
080bbf |
- struct npa_state **pnpa);
|
|
|
080bbf |
+NTSTATUS make_internal_rpc_pipe_socketpair(
|
|
|
080bbf |
+ TALLOC_CTX *mem_ctx,
|
|
|
080bbf |
+ struct tevent_context *ev_ctx,
|
|
|
080bbf |
+ struct messaging_context *msg_ctx,
|
|
|
080bbf |
+ const char *pipe_name,
|
|
|
080bbf |
+ const struct ndr_syntax_id *syntax,
|
|
|
080bbf |
+ const struct tsocket_address *remote_address,
|
|
|
080bbf |
+ const struct tsocket_address *local_address,
|
|
|
080bbf |
+ const struct auth_session_info *session_info,
|
|
|
080bbf |
+ struct npa_state **pnpa);
|
|
|
080bbf |
|
|
|
080bbf |
struct np_proxy_state {
|
|
|
080bbf |
uint16_t file_type;
|
|
|
080bbf |
diff --git a/source3/rpc_server/srv_pipe_hnd.c b/source3/rpc_server/srv_pipe_hnd.c
|
|
|
080bbf |
index f9b7855b40f..baa4ce96334 100644
|
|
|
080bbf |
--- a/source3/rpc_server/srv_pipe_hnd.c
|
|
|
080bbf |
+++ b/source3/rpc_server/srv_pipe_hnd.c
|
|
|
080bbf |
@@ -106,14 +106,16 @@ NTSTATUS np_open(TALLOC_CTX *mem_ctx, const char *name,
|
|
|
080bbf |
return NT_STATUS_OBJECT_NAME_NOT_FOUND;
|
|
|
080bbf |
}
|
|
|
080bbf |
|
|
|
080bbf |
- status = make_internal_rpc_pipe_socketpair(handle,
|
|
|
080bbf |
- ev_ctx,
|
|
|
080bbf |
- msg_ctx,
|
|
|
080bbf |
- name,
|
|
|
080bbf |
- &syntax,
|
|
|
080bbf |
- remote_client_address,
|
|
|
080bbf |
- session_info,
|
|
|
080bbf |
- &npa);
|
|
|
080bbf |
+ status = make_internal_rpc_pipe_socketpair(
|
|
|
080bbf |
+ handle,
|
|
|
080bbf |
+ ev_ctx,
|
|
|
080bbf |
+ msg_ctx,
|
|
|
080bbf |
+ name,
|
|
|
080bbf |
+ &syntax,
|
|
|
080bbf |
+ remote_client_address,
|
|
|
080bbf |
+ local_server_address,
|
|
|
080bbf |
+ session_info,
|
|
|
080bbf |
+ &npa);
|
|
|
080bbf |
if (!NT_STATUS_IS_OK(status)) {
|
|
|
080bbf |
talloc_free(handle);
|
|
|
080bbf |
return status;
|
|
|
080bbf |
--
|
|
|
080bbf |
2.11.0
|
|
|
080bbf |
|