[SCM] Samba Shared Repository - branch master updated

Volker Lendecke vlendec at samba.org
Fri Sep 4 09:39:02 UTC 2026


The branch, master has been updated
       via  96fe1454cb7 npsd_echo_server: Simplify npsd_echo_accept_client
       via  6f8897e6ffe rpc_worker: Pass the np_info to the nps_worker's accept_client callback
       via  21cbba615c3 rpc_worker: Pass the np_info to the worker's accept_client callback
       via  e1a849a3044 samba-dcerpcd: Pass the pipe info down to workers
       via  2d896f56e24 idl: Make named_pipe_auth_rep_info8 publically available
      from  8fd1e3196c4 selftest: add new wsp python bindings/wsp message test

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 96fe1454cb7c5e5b6ad9e2b9c730df3632ca761e
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Sep 2 17:03:05 2026 +0200

    npsd_echo_server: Simplify npsd_echo_accept_client
    
    Use the allocation size passed in from samba-dcerpcd
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    
    Autobuild-User(master): Volker Lendecke <vl at samba.org>
    Autobuild-Date(master): Fri Sep  4 09:38:48 UTC 2026 on atb-devel-224

commit 6f8897e6ffeeebf5fb6e38d058f10e0534fc806a
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Sep 2 17:01:08 2026 +0200

    rpc_worker: Pass the np_info to the nps_worker's accept_client callback
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>

commit 21cbba615c34adf045a0e3c61a527398b337fcea
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Sep 2 16:58:36 2026 +0200

    rpc_worker: Pass the np_info to the worker's accept_client callback
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>

commit e1a849a30449af4836bb70adcf800cebf49bb880
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Sep 2 16:43:16 2026 +0200

    samba-dcerpcd: Pass the pipe info down to workers
    
    The worker must know whether it's a BYTE or MESSAGE mode pipe to create the
    right kind of npa stream. The worker already knows what types of pipes it
    serves from get_interfaces, so this could be done with lookups in the worker,
    but as samba-dcerpcd also has this information available as part of its
    endpoint descriptions (which it got from get_interfaces), just send this down
    to the worker.
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>

commit 2d896f56e24e6c1b37a6ce16ad0394ba82225eea
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Sep 2 16:41:49 2026 +0200

    idl: Make named_pipe_auth_rep_info8 publically available
    
    Will be used in rpc_host_client
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 librpc/idl/named_pipe_auth.idl           |  2 +-
 source3/librpc/idl/rpc_host.idl          |  5 +++++
 source3/rpc_server/npsd_echo_server.c    | 16 +++++-----------
 source3/rpc_server/npsd_wsp_server.c     |  1 +
 source3/rpc_server/rpc_host.c            |  5 ++++-
 source3/rpc_server/rpc_worker_dcerpc.c   |  1 +
 source3/rpc_server/rpc_worker_internal.c | 11 ++++++-----
 source3/rpc_server/rpc_worker_internal.h |  2 ++
 source3/rpc_server/rpc_worker_nps.c      |  4 ++++
 source3/rpc_server/rpc_worker_nps.h      |  3 +++
 10 files changed, 32 insertions(+), 18 deletions(-)


Changeset truncated at 500 lines:

diff --git a/librpc/idl/named_pipe_auth.idl b/librpc/idl/named_pipe_auth.idl
index 807a312e4c0..624616bfe62 100644
--- a/librpc/idl/named_pipe_auth.idl
+++ b/librpc/idl/named_pipe_auth.idl
@@ -36,7 +36,7 @@ interface named_pipe_auth
 		[switch_is(level)] named_pipe_auth_req_info info;
 	} named_pipe_auth_req;
 
-	typedef struct {
+	typedef [public] struct {
 		uint16 file_type;
 		uint16 device_state;
 		hyper allocation_size;
diff --git a/source3/librpc/idl/rpc_host.idl b/source3/librpc/idl/rpc_host.idl
index 9eb48d3eaa8..676c9c1fff0 100644
--- a/source3/librpc/idl/rpc_host.idl
+++ b/source3/librpc/idl/rpc_host.idl
@@ -33,6 +33,11 @@ interface rpc_host_msg
 		 */
 		named_pipe_auth_req_info8 *npa_info8;
 
+		/**
+		 * @brief Named pipe info for the new connection
+		 */
+		named_pipe_auth_rep_info8 np_info;
+
 		/**
 		 * @brief Raw bind PDU
 		 *
diff --git a/source3/rpc_server/npsd_echo_server.c b/source3/rpc_server/npsd_echo_server.c
index 052d5e66440..72a7ac34b69 100644
--- a/source3/rpc_server/npsd_echo_server.c
+++ b/source3/rpc_server/npsd_echo_server.c
@@ -24,6 +24,7 @@
 #include "lib/tsocket/tsocket.h"
 #include "lib/util/tevent_unix.h"
 #include "rpc_server/rpc_worker_nps.h"
+#include "librpc/gen_ndr/named_pipe_auth.h"
 
 static const struct nps_interface npsd_echo_msg8_iface = {
 	.pipe_name		= "nps_echo_msg8",
@@ -112,6 +113,7 @@ static NTSTATUS npsd_echo_accept_client(
 		struct rpc_worker_connection *worker_conn,
 		struct auth_session_info **transport_session_info,
 		const char *pipe_name,
+		const struct named_pipe_auth_rep_info8 *np_info,
 		struct tstream_context **tstream,
 		struct tsocket_address **remote_client_addr,
 		struct tsocket_address **local_server_addr)
@@ -119,15 +121,6 @@ static NTSTATUS npsd_echo_accept_client(
 	struct tevent_context *ev_ctx = global_event_context();
 	struct npsd_echo_connection *echo_conn = NULL;
 	struct tevent_req *subreq = NULL;
-	size_t max_size;
-
-	if (strcmp(npsd_echo_msg8_iface.pipe_name, pipe_name) == 0) {
-		max_size = npsd_echo_msg8_iface.allocation_size;
-	} else if (strcmp(npsd_echo_msg16_iface.pipe_name, pipe_name) == 0) {
-		max_size = npsd_echo_msg16_iface.allocation_size;
-	} else {
-		return NT_STATUS_REQUEST_NOT_ACCEPTED;
-	}
 
 	echo_conn = talloc_zero(worker_conn, struct npsd_echo_connection);
 	if (echo_conn == NULL) {
@@ -140,9 +133,10 @@ static NTSTATUS npsd_echo_accept_client(
 	echo_conn->tstream = talloc_move(echo_conn, tstream);
 	echo_conn->remote_client_addr = talloc_move(echo_conn, remote_client_addr);
 	echo_conn->local_server_addr = talloc_move(echo_conn, local_server_addr);
-	echo_conn->max_size = max_size;
+	echo_conn->max_size = np_info->allocation_size;
 
-	DBG_NOTICE("starting echo server loop max_size=%zu\n", max_size);
+	DBG_NOTICE("starting echo server loop max_size=%zu\n",
+		   echo_conn->max_size);
 
 	subreq = tstream_monitor_send(echo_conn,
 				      echo_conn->ev,
diff --git a/source3/rpc_server/npsd_wsp_server.c b/source3/rpc_server/npsd_wsp_server.c
index 6deb6c3ec43..4011840a84a 100644
--- a/source3/rpc_server/npsd_wsp_server.c
+++ b/source3/rpc_server/npsd_wsp_server.c
@@ -174,6 +174,7 @@ static NTSTATUS wsp_server_accept_client(
 		struct rpc_worker_connection *worker_conn,
 		struct auth_session_info **transport_session_info,
 		const char *pipe_name,
+		const struct named_pipe_auth_rep_info8 *np_info,
 		struct tstream_context **tstream,
 		struct tsocket_address **remote_client_addr,
 		struct tsocket_address **local_server_addr)
diff --git a/source3/rpc_server/rpc_host.c b/source3/rpc_server/rpc_host.c
index 2f2d94824a7..0401feb2815 100644
--- a/source3/rpc_server/rpc_host.c
+++ b/source3/rpc_server/rpc_host.c
@@ -1130,10 +1130,13 @@ static struct tevent_req *rpc_host_new_client_send(
 	tevent_req_set_cleanup_fn(req, rpc_host_new_client_cleanup);
 
 	state->is_npsd = endpoint->server->is_npsd;
-	state->client = talloc_zero(state, struct rpc_host_client);
+	state->client = talloc(state, struct rpc_host_client);
 	if (tevent_req_nomem(state->client, req)) {
 		return tevent_req_post(req, ev);
 	}
+	*state->client = (struct rpc_host_client){
+		.np_info = endpoint->np_info,
+	};
 
 	/*
 	 * Dup the socket to read the first RPC packet:
diff --git a/source3/rpc_server/rpc_worker_dcerpc.c b/source3/rpc_server/rpc_worker_dcerpc.c
index e1cbf718087..ba4aec9b4b0 100644
--- a/source3/rpc_server/rpc_worker_dcerpc.c
+++ b/source3/rpc_server/rpc_worker_dcerpc.c
@@ -116,6 +116,7 @@ static NTSTATUS rpc_worker_dcerpc_accept_client(
 		struct auth_session_info **_transport_session_info,
 		struct dcerpc_binding **binding,
 		uint8_t _effective_transport,
+		const struct named_pipe_auth_rep_info8 *np_info,
 		DATA_BLOB *first_pdu,
 		struct tstream_context **tstream,
 		struct tsocket_address **remote_client_addr,
diff --git a/source3/rpc_server/rpc_worker_internal.c b/source3/rpc_server/rpc_worker_internal.c
index 19a35d4bef8..8b01a6e07fc 100644
--- a/source3/rpc_server/rpc_worker_internal.c
+++ b/source3/rpc_server/rpc_worker_internal.c
@@ -261,11 +261,10 @@ static void rpc_worker_new_client(
 	}
 
 	if (transport == NCACN_NP) {
-		ret = tstream_npa_existing_socket(
-			worker_conn,
-			sock,
-			FILE_TYPE_MESSAGE_MODE_PIPE,
-			&tstream);
+		ret = tstream_npa_existing_socket(worker_conn,
+						  sock,
+						  client->np_info.file_type,
+						  &tstream);
 		if (ret == -1) {
 			DBG_DEBUG("tstream_npa_existing_socket failed: %s\n",
 				  strerror(errno));
@@ -307,6 +306,7 @@ static void rpc_worker_new_client(
 				       &info8->session_info->session_info,
 				       &b,
 				       transport,
+				       &client->np_info,
 				       &client->bind_packet,
 				       &tstream,
 				       &remote_client_addr,
@@ -705,6 +705,7 @@ int rpc_worker_internal(
 		struct auth_session_info **transport_session_info,
 		struct dcerpc_binding **binding,
 		uint8_t _effective_transport,
+		const struct named_pipe_auth_rep_info8 *np_info,
 		DATA_BLOB *first_pdu,
 		struct tstream_context **tstream,
 		struct tsocket_address **remote_client_addr,
diff --git a/source3/rpc_server/rpc_worker_internal.h b/source3/rpc_server/rpc_worker_internal.h
index ccca635f16c..c909af45093 100644
--- a/source3/rpc_server/rpc_worker_internal.h
+++ b/source3/rpc_server/rpc_worker_internal.h
@@ -88,6 +88,7 @@ struct rpc_worker {
 		struct auth_session_info **transport_session_info,
 		struct dcerpc_binding **binding,
 		uint8_t _effective_transport,
+		const struct named_pipe_auth_rep_info8 *np_info,
 		DATA_BLOB *first_pdu,
 		struct tstream_context **tstream,
 		struct tsocket_address **remote_client_addr,
@@ -115,6 +116,7 @@ int rpc_worker_internal(
 		struct auth_session_info **transport_session_info,
 		struct dcerpc_binding **binding,
 		uint8_t _effective_transport,
+		const struct named_pipe_auth_rep_info8 *np_info,
 		DATA_BLOB *first_pdu,
 		struct tstream_context **tstream,
 		struct tsocket_address **remote_client_addr,
diff --git a/source3/rpc_server/rpc_worker_nps.c b/source3/rpc_server/rpc_worker_nps.c
index 9b538648428..e88b4a9f149 100644
--- a/source3/rpc_server/rpc_worker_nps.c
+++ b/source3/rpc_server/rpc_worker_nps.c
@@ -33,6 +33,7 @@ struct rpc_worker_nps_state {
 		struct rpc_worker_connection *worker_conn,
 		struct auth_session_info **transport_session_info,
 		const char *pipe_name,
+		const struct named_pipe_auth_rep_info8 *np_info,
 		struct tstream_context **tstream,
 		struct tsocket_address **remote_client_addr,
 		struct tsocket_address **local_server_addr);
@@ -97,6 +98,7 @@ static NTSTATUS rpc_worker_nps_accept_client(
 		struct auth_session_info **transport_session_info,
 		struct dcerpc_binding **_b,
 		uint8_t _effective_transport,
+		const struct named_pipe_auth_rep_info8 *np_info,
 		DATA_BLOB *first_pdu,
 		struct tstream_context **tstream,
 		struct tsocket_address **remote_client_addr,
@@ -148,6 +150,7 @@ static NTSTATUS rpc_worker_nps_accept_client(
 				      worker_conn,
 				      transport_session_info,
 				      pipe_name,
+				      np_info,
 				      tstream,
 				      remote_client_addr,
 				      local_server_addr);
@@ -239,6 +242,7 @@ int nps_worker_main(
 		struct rpc_worker_connection *worker_conn,
 		struct auth_session_info **transport_session_info,
 		const char *pipe_name,
+		const struct named_pipe_auth_rep_info8 *np_info,
 		struct tstream_context **tstream,
 		struct tsocket_address **remote_client_addr,
 		struct tsocket_address **local_server_addr),
diff --git a/source3/rpc_server/rpc_worker_nps.h b/source3/rpc_server/rpc_worker_nps.h
index 8519eee8167..2b1407221eb 100644
--- a/source3/rpc_server/rpc_worker_nps.h
+++ b/source3/rpc_server/rpc_worker_nps.h
@@ -34,6 +34,8 @@ struct nps_interface {
 	uint64_t allocation_size;
 };
 
+struct named_pipe_auth_rep_info8;
+
 int nps_worker_main(
 	int argc,
 	const char *argv[],
@@ -52,6 +54,7 @@ int nps_worker_main(
 		struct rpc_worker_connection *worker_conn,
 		struct auth_session_info **transport_session_info,
 		const char *pipe_name,
+		const struct named_pipe_auth_rep_info8 *np_info,
 		struct tstream_context **tstream,
 		struct tsocket_address **remote_client_addr,
 		struct tsocket_address **local_server_addr),


-- 
Samba Shared Repository



More information about the samba-cvs mailing list